From 6b67d954798176027bc1c345015212c5435dcc38 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 5 Feb 2023 22:48:29 +0000 Subject: [PATCH 01/10] feat: preliminary response body validation needs very refinement / cleaning up, but adds preliminary response body validation to typescript-koa template --- .../src/api.github.com.yaml/generated.ts | 86708 +++++++++++++++- .../src/petstore-expanded.yml/generated.ts | 32 + .../src/todo-lists.yml/generated.ts | 66 + .../typescript-koa.generator.ts | 24 +- 4 files changed, 86708 insertions(+), 122 deletions(-) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts index 2698d76fe..1c4593d3c 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts @@ -8408,6 +8408,47 @@ export function bootstrap( } const { status, body } = await implementation.metaRoot(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + current_user_url: z.coerce.string(), + current_user_authorizations_html_url: z.coerce.string(), + authorizations_url: z.coerce.string(), + code_search_url: z.coerce.string(), + commit_search_url: z.coerce.string(), + emails_url: z.coerce.string(), + emojis_url: z.coerce.string(), + events_url: z.coerce.string(), + feeds_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + hub_url: z.coerce.string(), + issue_search_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + label_search_url: z.coerce.string(), + notifications_url: z.coerce.string(), + organization_url: z.coerce.string(), + organization_repositories_url: z.coerce.string(), + organization_teams_url: z.coerce.string(), + public_gists_url: z.coerce.string(), + rate_limit_url: z.coerce.string(), + repository_url: z.coerce.string(), + repository_search_url: z.coerce.string(), + current_user_repositories_url: z.coerce.string(), + starred_url: z.coerce.string(), + starred_gists_url: z.coerce.string(), + topic_search_url: z.coerce.string().optional(), + user_url: z.coerce.string(), + user_organizations_url: z.coerce.string(), + user_repositories_url: z.coerce.string(), + user_search_url: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8424,6 +8465,59 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8450,6 +8544,32 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8470,6 +8590,18 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8498,6 +8630,18 @@ export function bootstrap( const { status, body } = await implementation.appsUpdateWebhookConfigForApp(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8527,6 +8671,65 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8554,6 +8757,69 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ headers: z.object({}), payload: z.object({}) }), + response: z.object({ + headers: z.object({}), + payload: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8579,6 +8845,49 @@ export function bootstrap( const { status, body } = await implementation.appsRedeliverWebhookDelivery(input, ctx) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8606,6 +8915,106 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8630,6 +9039,111 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8657,6 +9171,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8733,6 +9259,432 @@ export function bootstrap( const { status, body } = await implementation.appsCreateInstallationAccessToken(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + token: z.coerce.string(), + expires_at: z.coerce.string(), + permissions: z + .object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }) + .optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8760,6 +9712,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8787,6 +9751,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8818,6 +9794,32 @@ export function bootstrap( input, ctx ) + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8839,6 +9841,175 @@ export function bootstrap( } const { status, body } = await implementation.appsCheckToken(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8860,6 +10031,164 @@ export function bootstrap( } const { status, body } = await implementation.appsResetToken(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8883,6 +10212,32 @@ export function bootstrap( } const { status, body } = await implementation.appsDeleteToken(input, ctx) + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8947,6 +10302,197 @@ export function bootstrap( } const { status, body } = await implementation.appsScopeToken(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8963,6 +10509,81 @@ export function bootstrap( } const { status, body } = await implementation.appsGetBySlug(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -8980,6 +10601,21 @@ export function bootstrap( const { status, body } = await implementation.codesOfConductGetAllCodesOfConduct(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9005,6 +10641,30 @@ export function bootstrap( const { status, body } = await implementation.codesOfConductGetConductCode(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9019,6 +10679,11 @@ export function bootstrap( } const { status, body } = await implementation.emojisGet(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9045,6 +10710,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -9082,6 +10748,29 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + runner_groups: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9123,6 +10812,24 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9153,6 +10860,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9184,6 +10909,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -9215,6 +10941,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -9242,6 +10969,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -9269,6 +10997,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9302,6 +11057,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9329,6 +11121,32 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + advanced_security_enabled_for_new_repositories: z.coerce.boolean(), + secret_scanning_enabled_for_new_repositories: z.coerce.boolean(), + secret_scanning_push_protection_enabled_for_new_repositories: + z.coerce.boolean(), + secret_scanning_push_protection_custom_link: z.coerce + .string() + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9374,6 +11192,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9417,6 +11247,218 @@ export function bootstrap( const { status, body } = await implementation.dependabotListAlertsForEnterprise(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9456,6 +11498,194 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListAlertsForEnterprise(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }) + .optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9491,6 +11721,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9513,19 +11755,827 @@ export function bootstrap( input, ctx ) - ctx.status = status - ctx.body = body - return next() - }) - router.get("activityGetFeeds", "/feeds", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + ctx.status = status + ctx.body = body + return next() + }) + + router.get("activityGetFeeds", "/feeds", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, body: undefined, } const { status, body } = await implementation.activityGetFeeds(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + timeline_url: z.coerce.string(), + user_url: z.coerce.string(), + current_user_public_url: z.coerce.string().optional(), + current_user_url: z.coerce.string().optional(), + current_user_actor_url: z.coerce.string().optional(), + current_user_organization_url: z.coerce.string().optional(), + current_user_organization_urls: z.array(z.coerce.string()).optional(), + security_advisories_url: z.coerce.string().optional(), + repository_discussions_url: z.coerce.string().optional(), + repository_discussions_category_url: z.coerce.string().optional(), + _links: z.object({ + timeline: z.object({ + href: z.coerce.string(), + type: z.coerce.string(), + }), + user: z.object({ + href: z.coerce.string(), + type: z.coerce.string(), + }), + security_advisories: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_public: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_actor: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_organization: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_organizations: z + .array( + z.object({ href: z.coerce.string(), type: z.coerce.string() }) + ) + .optional(), + repository_discussions: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + repository_discussions_category: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9545,6 +12595,93 @@ export function bootstrap( } const { status, body } = await implementation.gistsList(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9564,6 +12701,286 @@ export function bootstrap( } const { status, body } = await implementation.gistsCreate(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9583,6 +13000,118 @@ export function bootstrap( } const { status, body } = await implementation.gistsListPublic(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9602,6 +13131,104 @@ export function bootstrap( } const { status, body } = await implementation.gistsListStarred(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9617,6 +13244,266 @@ export function bootstrap( } const { status, body } = await implementation.gistsGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + block: z + .object({ + reason: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9637,6 +13524,275 @@ export function bootstrap( } const { status, body } = await implementation.gistsUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9652,6 +13808,29 @@ export function bootstrap( } const { status, body } = await implementation.gistsDelete(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9678,6 +13857,77 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9702,6 +13952,75 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9724,6 +14043,80 @@ export function bootstrap( } const { status, body } = await implementation.gistsGetComment(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + block: z + .object({ + reason: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9751,6 +14144,64 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9776,6 +14227,29 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9800,6 +14274,69 @@ export function bootstrap( } const { status, body } = await implementation.gistsListCommits(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + version: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + change_status: z.object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }), + committed_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9821,6 +14358,263 @@ export function bootstrap( } const { status, body } = await implementation.gistsListForks(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9836,6 +14630,127 @@ export function bootstrap( } const { status, body } = await implementation.gistsFork(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9859,6 +14774,22 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9875,6 +14806,29 @@ export function bootstrap( } const { status, body } = await implementation.gistsStar(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9890,6 +14844,29 @@ export function bootstrap( } const { status, body } = await implementation.gistsUnstar(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9908,6 +14885,286 @@ export function bootstrap( } const { status, body } = await implementation.gistsGetRevision(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9927,6 +15184,11 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.array(z.coerce.string()).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9949,6 +15211,13 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ name: z.coerce.string(), source: z.coerce.string() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9975,6 +15244,339 @@ export function bootstrap( const { status, body } = await implementation.appsListReposAccessibleToInstallation(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + repository_selection: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -9993,6 +15595,7 @@ export function bootstrap( const { status, body } = await implementation.appsRevokeInstallationAccessToken(input, ctx) + ctx.status = status ctx.body = body return next() @@ -10024,6 +15627,615 @@ export function bootstrap( } const { status, body } = await implementation.issuesList(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10049,6 +16261,22 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10064,6 +16292,49 @@ export function bootstrap( } const { status, body } = await implementation.licensesGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + spdx_id: z.coerce.string(), + url: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + description: z.coerce.string(), + implementation: z.coerce.string(), + permissions: z.array(z.coerce.string()), + conditions: z.array(z.coerce.string()), + limitations: z.array(z.coerce.string()), + body: z.coerce.string(), + featured: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10083,6 +16354,11 @@ export function bootstrap( } const { status, body } = await implementation.markdownRender(input, ctx) + + if (status === 200) { + ctx.body = z.coerce.string().parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10098,6 +16374,11 @@ export function bootstrap( } const { status, body } = await implementation.markdownRenderRaw(input, ctx) + + if (status === 200) { + ctx.body = z.coerce.string().parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10122,6 +16403,93 @@ export function bootstrap( const { status, body } = await implementation.appsGetSubscriptionPlanForAccount(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10143,7 +16511,52 @@ export function bootstrap( body: undefined, } - const { status, body } = await implementation.appsListPlans(input, ctx) + const { status, body } = await implementation.appsListPlans(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10178,6 +16591,120 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10206,6 +16733,82 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10231,6 +16834,40 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10266,6 +16903,84 @@ export function bootstrap( const { status, body } = await implementation.appsListAccountsForPlanStubbed(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10280,6 +16995,33 @@ export function bootstrap( } const { status, body } = await implementation.metaGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + verifiable_password_authentication: z.coerce.boolean(), + ssh_key_fingerprints: z + .object({ + SHA256_RSA: z.coerce.string().optional(), + SHA256_DSA: z.coerce.string().optional(), + SHA256_ECDSA: z.coerce.string().optional(), + SHA256_ED25519: z.coerce.string().optional(), + }) + .optional(), + ssh_keys: z.array(z.coerce.string()).optional(), + hooks: z.array(z.coerce.string()).optional(), + web: z.array(z.coerce.string()).optional(), + api: z.array(z.coerce.string()).optional(), + git: z.array(z.coerce.string()).optional(), + packages: z.array(z.coerce.string()).optional(), + pages: z.array(z.coerce.string()).optional(), + importer: z.array(z.coerce.string()).optional(), + actions: z.array(z.coerce.string()).optional(), + dependabot: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10313,6 +17055,788 @@ export function bootstrap( const { status, body } = await implementation.activityListPublicEventsForRepoNetwork(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10346,6 +17870,238 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10374,6 +18130,35 @@ export function bootstrap( const { status, body } = await implementation.activityMarkNotificationsAsRead(input, ctx) + + if (status === 202) { + ctx.body = z + .object({ message: z.coerce.string().optional() }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10398,6 +18183,211 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10425,6 +18415,18 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10453,6 +18455,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + thread_url: z.coerce.string().optional(), + repository_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10485,6 +18524,43 @@ export function bootstrap( const { status, body } = await implementation.activitySetThreadSubscription(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + thread_url: z.coerce.string().optional(), + repository_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10510,6 +18586,29 @@ export function bootstrap( const { status, body } = await implementation.activityDeleteThreadSubscription(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10528,6 +18627,11 @@ export function bootstrap( } const { status, body } = await implementation.metaGetOctocat(input, ctx) + + if (status === 200) { + ctx.body = z.coerce.string().parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10546,6 +18650,28 @@ export function bootstrap( } const { status, body } = await implementation.orgsList(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10561,6 +18687,111 @@ export function bootstrap( } const { status, body } = await implementation.orgsGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce.boolean().optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + advanced_security_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_alerts_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_security_updates_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependency_graph_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link_enabled: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link: z.coerce + .string() + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10628,6 +18859,143 @@ export function bootstrap( } const { status, body } = await implementation.orgsUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce.boolean().optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + advanced_security_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_alerts_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_security_updates_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependency_graph_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link_enabled: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link: z.coerce + .string() + .optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .union([ + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ]) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10652,6 +19020,16 @@ export function bootstrap( const { status, body } = await implementation.actionsGetActionsCacheUsageForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_active_caches_count: z.coerce.number(), + total_active_caches_size_in_bytes: z.coerce.number(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10685,6 +19063,22 @@ export function bootstrap( const { status, body } = await implementation.actionsGetActionsCacheUsageByRepoForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repository_cache_usages: z.array( + z.object({ + full_name: z.coerce.string(), + active_caches_size_in_bytes: z.coerce.number(), + active_caches_count: z.coerce.number(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10710,6 +19104,13 @@ export function bootstrap( const { status, body } = await implementation.oidcGetOidcCustomSubTemplateForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ include_claim_keys: z.array(z.coerce.string()) }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10742,6 +19143,33 @@ export function bootstrap( const { status, body } = await implementation.oidcUpdateOidcCustomSubTemplateForOrg(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10770,6 +19198,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + enabled_repositories: z.enum(["all", "none", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + allowed_actions: z + .enum(["all", "local_only", "selected"]) + .optional(), + selected_actions_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10806,6 +19248,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -10842,6 +19285,316 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10875,6 +19628,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -10902,6 +19656,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -10929,6 +19684,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -10954,6 +19710,17 @@ export function bootstrap( const { status, body } = await implementation.actionsGetAllowedActionsOrganization(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + github_owned_allowed: z.coerce.boolean().optional(), + verified_allowed: z.coerce.boolean().optional(), + patterns_allowed: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -10990,6 +19757,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetAllowedActionsOrganization(input, ctx) + ctx.status = status ctx.body = body return next() @@ -11017,6 +19785,16 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + default_workflow_permissions: z.enum(["read", "write"]), + can_approve_pull_request_reviews: z.coerce.boolean(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11055,6 +19833,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11088,6 +19867,190 @@ export function bootstrap( const { status, body } = await implementation.actionsListRequiredWorkflows(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + required_workflows: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11123,6 +20086,195 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRequiredWorkflow(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11151,6 +20303,185 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11187,6 +20518,195 @@ export function bootstrap( const { status, body } = await implementation.actionsUpdateRequiredWorkflow(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11213,6 +20733,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteRequiredWorkflow(input, ctx) + ctx.status = status ctx.body = body return next() @@ -11242,6 +20763,316 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11278,6 +21109,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11308,6 +21140,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11338,6 +21171,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11372,6 +21206,33 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnerGroupsForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + runner_groups: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce + .boolean() + .optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11413,6 +21274,26 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce.boolean().optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11439,6 +21320,26 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerGroupForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce.boolean().optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11479,6 +21380,26 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce.boolean().optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11508,6 +21429,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11546,6 +21468,179 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11582,6 +21677,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11613,6 +21709,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11650,6 +21747,31 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11686,6 +21808,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11713,6 +21836,7 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelfHostedRunnerToGroupForOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -11743,6 +21867,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -11776,6 +21901,31 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnersForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11801,6 +21951,22 @@ export function bootstrap( const { status, body } = await implementation.actionsListRunnerApplicationsForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11826,6 +21992,322 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRegistrationTokenForOrg(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11851,6 +22333,322 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRemoveTokenForOrg(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11877,6 +22675,26 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11903,6 +22721,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteSelfHostedRunnerFromOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -11932,6 +22751,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -11968,6 +22814,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12004,6 +22887,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12031,6 +22951,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12062,6 +23009,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12089,6 +23073,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12114,6 +23116,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12139,6 +23155,19 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12175,6 +23204,11 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateOrgSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12203,6 +23237,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -12237,6 +23272,179 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelectedReposForOrgSecret(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12270,6 +23478,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetSelectedReposForOrgSecret(input, ctx) + ctx.status = status ctx.body = body return next() @@ -12297,6 +23506,7 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelectedRepoToOrgSecret(input, ctx) + ctx.status = status ctx.body = body return next() @@ -12324,6 +23534,7 @@ export function bootstrap( const { status, body } = await implementation.actionsRemoveSelectedRepoFromOrgSecret(input, ctx) + ctx.status = status ctx.body = body return next() @@ -12356,6 +23567,25 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12390,6 +23620,11 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12415,6 +23650,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12450,6 +23699,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -12478,6 +23728,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -12512,6 +23763,179 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelectedReposForOrgVariable(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12545,6 +23969,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetSelectedReposForOrgVariable(input, ctx) + ctx.status = status ctx.body = body return next() @@ -12572,6 +23997,7 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelectedRepoToOrgVariable(input, ctx) + ctx.status = status ctx.body = body return next() @@ -12602,6 +24028,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -12626,6 +24053,37 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12650,6 +24108,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12672,6 +24142,32 @@ export function bootstrap( } const { status, body } = await implementation.orgsBlockUser(input, ctx) + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12694,6 +24190,7 @@ export function bootstrap( } const { status, body } = await implementation.orgsUnblockUser(input, ctx) + ctx.status = status ctx.body = body return next() @@ -12737,6 +24234,195 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListAlertsForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12770,6 +24456,350 @@ export function bootstrap( const { status, body } = await implementation.codespacesListInOrganization(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12808,6 +24838,54 @@ export function bootstrap( const { status, body } = await implementation.codespacesSetCodespacesBilling(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12843,6 +24921,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12870,6 +24966,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12898,6 +25008,19 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12934,6 +25057,47 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateOrUpdateOrgSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12962,6 +25126,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -12996,6 +25172,190 @@ export function bootstrap( const { status, body } = await implementation.codespacesListSelectedReposForOrgSecret(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13027,8 +25387,20 @@ export function bootstrap( ), } - const { status, body } = - await implementation.codespacesSetSelectedReposForOrgSecret(input, ctx) + const { status, body } = + await implementation.codespacesSetSelectedReposForOrgSecret(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13056,6 +25428,43 @@ export function bootstrap( const { status, body } = await implementation.codespacesAddSelectedRepoToOrgSecret(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13086,6 +25495,43 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13131,6 +25577,231 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13166,6 +25837,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13193,6 +25882,13 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ key_id: z.coerce.string(), key: z.coerce.string() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13221,6 +25917,19 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13257,6 +25966,11 @@ export function bootstrap( const { status, body } = await implementation.dependabotCreateOrUpdateOrgSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13285,6 +25999,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -13319,6 +26034,179 @@ export function bootstrap( const { status, body } = await implementation.dependabotListSelectedReposForOrgSecret(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13352,6 +26240,7 @@ export function bootstrap( const { status, body } = await implementation.dependabotSetSelectedReposForOrgSecret(input, ctx) + ctx.status = status ctx.body = body return next() @@ -13379,6 +26268,7 @@ export function bootstrap( const { status, body } = await implementation.dependabotAddSelectedRepoToOrgSecret(input, ctx) + ctx.status = status ctx.body = body return next() @@ -13409,6 +26299,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -13444,6 +26335,755 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13479,6 +27119,61 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13500,6 +27195,43 @@ export function bootstrap( } const { status, body } = await implementation.orgsListWebhooks(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13529,6 +27261,66 @@ export function bootstrap( } const { status, body } = await implementation.orgsCreateWebhook(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13550,6 +27342,41 @@ export function bootstrap( } const { status, body } = await implementation.orgsGetWebhook(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13591,6 +27418,66 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13616,6 +27503,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13644,6 +27543,18 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13682,6 +27593,18 @@ export function bootstrap( const { status, body } = await implementation.orgsUpdateWebhookConfigForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13719,6 +27642,65 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13748,6 +27730,69 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ headers: z.object({}), payload: z.object({}) }), + response: z.object({ + headers: z.object({}), + payload: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13775,6 +27820,49 @@ export function bootstrap( const { status, body } = await implementation.orgsRedeliverWebhookDelivery(input, ctx) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13797,6 +27885,18 @@ export function bootstrap( } const { status, body } = await implementation.orgsPingWebhook(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13822,6 +27922,100 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13857,6 +28051,111 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + installations: z.array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13882,6 +28181,11 @@ export function bootstrap( const { status, body } = await implementation.interactionsGetRestrictionsForOrg(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13921,6 +28225,46 @@ export function bootstrap( const { status, body } = await implementation.interactionsSetRestrictionsForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -13946,6 +28290,7 @@ export function bootstrap( const { status, body } = await implementation.interactionsRemoveRestrictionsForOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -13981,6 +28326,61 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14012,6 +28412,84 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14037,6 +28515,43 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14070,6 +28585,61 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14099,6 +28669,590 @@ export function bootstrap( } const { status, body } = await implementation.issuesListForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14121,6 +29275,62 @@ export function bootstrap( } const { status, body } = await implementation.orgsListMembers(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14148,6 +29358,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -14170,6 +29381,18 @@ export function bootstrap( } const { status, body } = await implementation.orgsRemoveMember(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14202,8 +29425,352 @@ export function bootstrap( body: undefined, } - const { status, body } = - await implementation.codespacesGetCodespacesForUserInOrg(input, ctx) + const { status, body } = + await implementation.codespacesGetCodespacesForUserInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14231,6 +29798,55 @@ export function bootstrap( const { status, body } = await implementation.codespacesDeleteFromOrganization(input, ctx) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14258,6 +29874,341 @@ export function bootstrap( const { status, body } = await implementation.codespacesStopInOrganization(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14286,6 +30237,80 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14318,6 +30343,94 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14346,6 +30459,29 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14374,6 +30510,356 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14408,6 +30894,390 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14443,6 +31313,365 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14469,6 +31698,18 @@ export function bootstrap( const { status, body } = await implementation.migrationsDownloadArchiveForOrg(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14495,6 +31736,18 @@ export function bootstrap( const { status, body } = await implementation.migrationsDeleteArchiveForOrg(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14524,6 +31777,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14560,6 +31825,187 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14594,6 +32040,37 @@ export function bootstrap( const { status, body } = await implementation.orgsListOutsideCollaborators(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14627,6 +32104,22 @@ export function bootstrap( const { status, body } = await implementation.orgsConvertMemberToOutsideCollaborator(input, ctx) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14653,6 +32146,16 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveOutsideCollaborator(input, ctx) + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14693,6 +32196,243 @@ export function bootstrap( const { status, body } = await implementation.packagesListPackagesForOrganization(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14727,6 +32467,219 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageForOrganization(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14763,6 +32716,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14804,6 +32791,40 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageForOrg(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14854,6 +32875,80 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14892,6 +32987,42 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce.string().datetime({ offset: true }).optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14927,6 +33058,40 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageVersionForOrg(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14962,6 +33127,40 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageVersionForOrg(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -14984,6 +33183,65 @@ export function bootstrap( } const { status, body } = await implementation.projectsListForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15010,6 +33268,107 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15037,6 +33396,37 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15063,6 +33453,7 @@ export function bootstrap( const { status, body } = await implementation.orgsCheckPublicMembershipForUser(input, ctx) + ctx.status = status ctx.body = body return next() @@ -15092,6 +33483,18 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15121,6 +33524,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -15147,6 +33551,167 @@ export function bootstrap( } const { status, body } = await implementation.reposListForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15193,6 +33758,343 @@ export function bootstrap( } const { status, body } = await implementation.reposCreateInOrg(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15232,6 +34134,194 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListAlertsForOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }) + .optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15257,6 +34347,28 @@ export function bootstrap( const { status, body } = await implementation.orgsListSecurityManagerTeams(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15285,6 +34397,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -15311,6 +34424,7 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveSecurityManagerTeam(input, ctx) + ctx.status = status ctx.body = body return next() @@ -15336,6 +34450,34 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubActionsBillingOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_minutes_used: z.coerce.number(), + total_paid_minutes_used: z.coerce.number(), + included_minutes: z.coerce.number(), + minutes_used_breakdown: z.object({ + UBUNTU: z.coerce.number().optional(), + MACOS: z.coerce.number().optional(), + WINDOWS: z.coerce.number().optional(), + ubuntu_4_core: z.coerce.number().optional(), + ubuntu_8_core: z.coerce.number().optional(), + ubuntu_16_core: z.coerce.number().optional(), + ubuntu_32_core: z.coerce.number().optional(), + ubuntu_64_core: z.coerce.number().optional(), + windows_4_core: z.coerce.number().optional(), + windows_8_core: z.coerce.number().optional(), + windows_16_core: z.coerce.number().optional(), + windows_32_core: z.coerce.number().optional(), + windows_64_core: z.coerce.number().optional(), + macos_12_core: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15361,6 +34503,17 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubPackagesBillingOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_gigabytes_bandwidth_used: z.coerce.number(), + total_paid_gigabytes_bandwidth_used: z.coerce.number(), + included_gigabytes_bandwidth: z.coerce.number(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15386,6 +34539,17 @@ export function bootstrap( const { status, body } = await implementation.billingGetSharedStorageBillingOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + days_left_in_billing_cycle: z.coerce.number(), + estimated_paid_storage_for_month: z.coerce.number(), + estimated_storage_for_month: z.coerce.number(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15407,6 +34571,61 @@ export function bootstrap( } const { status, body } = await implementation.teamsList(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15432,6 +34651,150 @@ export function bootstrap( } const { status, body } = await implementation.teamsCreate(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15453,6 +34816,125 @@ export function bootstrap( } const { status, body } = await implementation.teamsGetByName(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15485,6 +34967,268 @@ export function bootstrap( } const { status, body } = await implementation.teamsUpdateInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15507,6 +35251,7 @@ export function bootstrap( } const { status, body } = await implementation.teamsDeleteInOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -15545,6 +35290,69 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15579,6 +35387,67 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15608,6 +35477,67 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15644,6 +35574,67 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15673,6 +35664,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -15709,6 +35701,64 @@ export function bootstrap( const { status, body } = await implementation.teamsListDiscussionCommentsInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15743,6 +35793,62 @@ export function bootstrap( const { status, body } = await implementation.teamsCreateDiscussionCommentInOrg(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15771,6 +35877,62 @@ export function bootstrap( const { status, body } = await implementation.teamsGetDiscussionCommentInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15806,6 +35968,62 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateDiscussionCommentInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15834,6 +36052,7 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteDiscussionCommentInOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -15885,6 +36104,52 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15932,6 +36197,93 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -15961,6 +36313,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForTeamDiscussionComment(input, ctx) + ctx.status = status ctx.body = body return next() @@ -16008,6 +36361,52 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForTeamDiscussionInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16051,6 +36450,93 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForTeamDiscussionInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16079,6 +36565,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForTeamDiscussion(input, ctx) + ctx.status = status ctx.body = body return next() @@ -16113,6 +36600,50 @@ export function bootstrap( const { status, body } = await implementation.teamsListPendingInvitationsInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16144,6 +36675,37 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16171,6 +36733,17 @@ export function bootstrap( const { status, body } = await implementation.teamsGetMembershipForUserInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16205,6 +36778,17 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateMembershipForUserInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16232,6 +36816,7 @@ export function bootstrap( const { status, body } = await implementation.teamsRemoveMembershipForUserInOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -16265,6 +36850,58 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16292,6 +36929,56 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForProjectInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16326,6 +37013,16 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateProjectPermissionsInOrg(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16355,6 +37052,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -16385,6 +37083,176 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16413,6 +37281,441 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForRepoInOrg(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16448,6 +37751,7 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateRepoPermissionsInOrg(input, ctx) + ctx.status = status ctx.body = body return next() @@ -16475,6 +37779,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -16505,6 +37810,50 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16542,6 +37891,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -16561,6 +37911,82 @@ export function bootstrap( } const { status, body } = await implementation.projectsGetCard(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16590,6 +38016,92 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16612,6 +38124,39 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16636,6 +38181,84 @@ export function bootstrap( } const { status, body } = await implementation.projectsMoveCard(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16660,6 +38283,55 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16686,6 +38358,44 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16710,6 +38420,29 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16740,6 +38473,73 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16772,6 +38572,121 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .union([ + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ]) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16798,6 +38713,43 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16814,6 +38766,75 @@ export function bootstrap( } const { status, body } = await implementation.projectsGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16841,21 +38862,154 @@ export function bootstrap( } const { status, body } = await implementation.projectsUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() }) - const projectsDeleteParamSchema = z.object({ project_id: z.coerce.number() }) + const projectsDeleteParamSchema = z.object({ project_id: z.coerce.number() }) + + router.delete("projectsDelete", "/projects/:projectId", async (ctx, next) => { + const input = { + params: parseRequestInput(projectsDeleteParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.projectsDelete(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } - router.delete("projectsDelete", "/projects/:projectId", async (ctx, next) => { - const input = { - params: parseRequestInput(projectsDeleteParamSchema, ctx.params), - query: undefined, - body: undefined, + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) } - const { status, body } = await implementation.projectsDelete(input, ctx) ctx.status = status ctx.body = body return next() @@ -16891,6 +39045,95 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16923,6 +39166,65 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16951,6 +39253,65 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -16977,6 +39338,96 @@ export function bootstrap( const { status, body } = await implementation.projectsGetPermissionForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + permission: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17006,6 +39457,46 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17032,6 +39523,54 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17046,6 +39585,101 @@ export function bootstrap( } const { status, body } = await implementation.rateLimitGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + resources: z.object({ + core: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), + graphql: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + search: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), + source_import: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + integration_manifest: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + code_scanning_upload: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + actions_runner_registration: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + scim: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + dependency_snapshots: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + }), + rate: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17079,6 +39713,202 @@ export function bootstrap( const { status, body } = await implementation.actionsListRepoRequiredWorkflows(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + required_workflows: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum(["active", "deleted"]), + source_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17106,6 +39936,197 @@ export function bootstrap( const { status, body } = await implementation.actionsGetRepoRequiredWorkflow(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum(["active", "deleted"]), + source_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17133,6 +40154,36 @@ export function bootstrap( const { status, body } = await implementation.actionsGetRepoRequiredWorkflowUsage(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + billable: z.object({ + UBUNTU: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + MACOS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + WINDOWS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17152,6 +40203,1129 @@ export function bootstrap( } const { status, body } = await implementation.reposGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17181,41 +41355,1189 @@ export function bootstrap( .object({ status: z.coerce.string().optional() }) .optional(), }) - .optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - default_branch: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), - archived: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }) - .optional() - - router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateBodySchema, ctx.body), + .optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + default_branch: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + archived: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }) + .optional() + + router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { + const input = { + params: parseRequestInput(reposUpdateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 307) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) } - const { status, body } = await implementation.reposUpdate(input, ctx) ctx.status = status ctx.body = body return next() @@ -17234,6 +42556,38 @@ export function bootstrap( } const { status, body } = await implementation.reposDelete(input, ctx) + + if (status === 307) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17270,6 +42624,38 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17296,6 +42682,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17322,6 +42735,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -17352,6 +42766,18 @@ export function bootstrap( input, ctx ) + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17380,6 +42806,17 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + full_name: z.coerce.string(), + active_caches_size_in_bytes: z.coerce.number(), + active_caches_count: z.coerce.number(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17422,6 +42859,32 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + actions_caches: z.array( + z.object({ + id: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + version: z.coerce.string().optional(), + last_accessed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + size_in_bytes: z.coerce.number().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17456,6 +42919,32 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteActionsCacheByKey(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + actions_caches: z.array( + z.object({ + id: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + version: z.coerce.string().optional(), + last_accessed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + size_in_bytes: z.coerce.number().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17483,6 +42972,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteActionsCacheById(input, ctx) + ctx.status = status ctx.body = body return next() @@ -17512,6 +43002,61 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17539,6 +43084,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) + ctx.status = status ctx.body = body return next() @@ -17573,6 +43119,22 @@ export function bootstrap( const { status, body } = await implementation.actionsReRunJobForWorkflowRun(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17599,6 +43161,40 @@ export function bootstrap( const { status, body } = await implementation.actionsGetCustomOidcSubClaimForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + use_default: z.coerce.boolean(), + include_claim_keys: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17633,6 +43229,45 @@ export function bootstrap( const { status, body } = await implementation.actionsSetCustomOidcSubClaimForRepo(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17662,6 +43297,19 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + enabled: z.coerce.boolean(), + allowed_actions: z + .enum(["all", "local_only", "selected"]) + .optional(), + selected_actions_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17699,6 +43347,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -17725,6 +43374,20 @@ export function bootstrap( const { status, body } = await implementation.actionsGetWorkflowAccessToRepository(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + access_level: z.enum([ + "none", + "user", + "organization", + "enterprise", + ]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17758,6 +43421,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetWorkflowAccessToRepository(input, ctx) + ctx.status = status ctx.body = body return next() @@ -17784,6 +43448,17 @@ export function bootstrap( const { status, body } = await implementation.actionsGetAllowedActionsRepository(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + github_owned_allowed: z.coerce.boolean().optional(), + verified_allowed: z.coerce.boolean().optional(), + patterns_allowed: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17821,6 +43496,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetAllowedActionsRepository(input, ctx) + ctx.status = status ctx.body = body return next() @@ -17848,6 +43524,16 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + default_workflow_permissions: z.enum(["read", "write"]), + can_approve_pull_request_reviews: z.coerce.boolean(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17884,6 +43570,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -17943,6 +43630,473 @@ export function bootstrap( const { status, body } = await implementation.actionsListRequiredWorkflowRuns(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -17977,6 +44131,31 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnersForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18003,6 +44182,22 @@ export function bootstrap( const { status, body } = await implementation.actionsListRunnerApplicationsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18029,6 +44224,322 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRegistrationTokenForRepo(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18055,6 +44566,322 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRemoveTokenForRepo(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18082,6 +44909,26 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18109,6 +44956,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) + ctx.status = status ctx.body = body return next() @@ -18139,6 +44987,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18176,6 +45051,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18213,6 +45125,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18244,6 +45193,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18276,6 +45252,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18334,6 +45347,473 @@ export function bootstrap( const { status, body } = await implementation.actionsListWorkflowRunsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18364,6 +45844,468 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18393,6 +46335,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -18422,6 +46365,58 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + environments: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + state: z.enum(["approved", "rejected"]), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comment: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18451,6 +46446,33 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18486,6 +46508,38 @@ export function bootstrap( const { status, body } = await implementation.actionsListWorkflowRunArtifacts(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18521,6 +46575,468 @@ export function bootstrap( const { status, body } = await implementation.actionsGetWorkflowRunAttempt(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18557,6 +47073,77 @@ export function bootstrap( const { status, body } = await implementation.actionsListJobsForWorkflowRunAttempt(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + jobs: z.array( + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18585,6 +47172,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) + ctx.status = status ctx.body = body return next() @@ -18614,6 +47202,22 @@ export function bootstrap( input, ctx ) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18650,6 +47254,66 @@ export function bootstrap( const { status, body } = await implementation.actionsListJobsForWorkflowRun(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + jobs: z.array( + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18677,6 +47341,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDownloadWorkflowRunLogs(input, ctx) + ctx.status = status ctx.body = body return next() @@ -18704,6 +47369,29 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteWorkflowRunLogs(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18731,6 +47419,34 @@ export function bootstrap( const { status, body } = await implementation.actionsGetPendingDeploymentsForRun(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + environment: z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }), + wait_timer: z.coerce.number(), + wait_timer_started_at: z.coerce + .string() + .datetime({ offset: true }), + current_user_can_approve: z.coerce.boolean(), + reviewers: z.array( + z.object({ + type: z.enum(["User", "Team"]).optional(), + reviewer: z.object({}).optional(), + }) + ), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18767,6 +47483,104 @@ export function bootstrap( const { status, body } = await implementation.actionsReviewPendingDeploymentsForRun(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18797,6 +47611,11 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18831,6 +47650,11 @@ export function bootstrap( const { status, body } = await implementation.actionsReRunWorkflowFailedJobs(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18860,6 +47684,59 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + billable: z.object({ + UBUNTU: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + MACOS: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + WINDOWS: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + }), + run_duration_ms: z.coerce.number().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18893,6 +47770,22 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18921,6 +47814,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18947,6 +47854,17 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -18982,6 +47900,11 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateRepoSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19011,6 +47934,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -19047,6 +47971,23 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19080,6 +48021,11 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19109,6 +48055,18 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19143,6 +48101,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -19172,6 +48131,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -19208,6 +48168,39 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + workflows: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19234,6 +48227,31 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + deleted_at: z.coerce.string().datetime({ offset: true }).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19263,6 +48281,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -19298,6 +48317,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateWorkflowDispatch(input, ctx) + ctx.status = status ctx.body = body return next() @@ -19324,6 +48344,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -19382,6 +48403,473 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19411,6 +48899,25 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + billable: z.object({ + UBUNTU: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + MACOS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + WINDOWS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19441,6 +48948,48 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19468,6 +49017,18 @@ export function bootstrap( const { status, body } = await implementation.issuesCheckUserCanBeAssigned(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19497,6 +49058,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19528,6 +49103,43 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19551,6 +49163,29 @@ export function bootstrap( } const { status, body } = await implementation.reposGetAutolink(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19577,6 +49212,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19603,6 +49250,7 @@ export function bootstrap( const { status, body } = await implementation.reposEnableAutomatedSecurityFixes(input, ctx) + ctx.status = status ctx.body = body return next() @@ -19629,6 +49277,7 @@ export function bootstrap( const { status, body } = await implementation.reposDisableAutomatedSecurityFixes(input, ctx) + ctx.status = status ctx.body = body return next() @@ -19660,6 +49309,455 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + protected: z.coerce.boolean(), + protection: z + .object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce + .number() + .optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce + .number() + .optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce + .number() + .optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }) + .optional(), + protection_url: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19683,6 +49781,571 @@ export function bootstrap( } const { status, body } = await implementation.reposGetBranch(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + _links: z.object({ + html: z.coerce.string(), + self: z.coerce.string(), + }), + protected: z.coerce.boolean(), + protection: z.object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }), + protection_url: z.coerce.string(), + pattern: z.coerce.string().optional(), + required_approving_review_count: z.coerce.number().optional(), + }) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19712,6 +50375,430 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19792,6 +50879,439 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + required_status_checks: z + .object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string(), + }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + dismissal_restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + }) + .optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19821,6 +51341,18 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19848,6 +51380,13 @@ export function bootstrap( const { status, body } = await implementation.reposGetAdminBranchProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19875,6 +51414,13 @@ export function bootstrap( const { status, body } = await implementation.reposSetAdminBranchProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19902,6 +51448,18 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteAdminBranchProtection(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19929,6 +51487,266 @@ export function bootstrap( const { status, body } = await implementation.reposGetPullRequestReviewProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -19982,6 +51800,291 @@ export function bootstrap( const { status, body } = await implementation.reposUpdatePullRequestReviewProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20009,6 +52112,18 @@ export function bootstrap( const { status, body } = await implementation.reposDeletePullRequestReviewProtection(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20036,6 +52151,24 @@ export function bootstrap( const { status, body } = await implementation.reposGetCommitSignatureProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20063,6 +52196,24 @@ export function bootstrap( const { status, body } = await implementation.reposCreateCommitSignatureProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20090,6 +52241,18 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteCommitSignatureProtection(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20117,6 +52280,35 @@ export function bootstrap( const { status, body } = await implementation.reposGetStatusChecksProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20162,6 +52354,60 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateStatusCheckProtection(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20189,6 +52435,7 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveStatusCheckProtection(input, ctx) + ctx.status = status ctx.body = body return next() @@ -20216,6 +52463,22 @@ export function bootstrap( const { status, body } = await implementation.reposGetAllStatusCheckContexts(input, ctx) + + if (status === 200) { + ctx.body = z.array(z.coerce.string()).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20253,6 +52516,58 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.array(z.coerce.string()).parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20290,6 +52605,47 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.array(z.coerce.string()).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20325,6 +52681,47 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveStatusCheckContexts(input, ctx) + + if (status === 200) { + ctx.body = z.array(z.coerce.string()).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20354,6 +52751,116 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20381,6 +52888,7 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteAccessRestrictions(input, ctx) + ctx.status = status ctx.body = body return next() @@ -20408,6 +52916,72 @@ export function bootstrap( const { status, body } = await implementation.reposGetAppsWithAccessToProtectedBranch(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20443,6 +53017,86 @@ export function bootstrap( const { status, body } = await implementation.reposAddAppAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20478,6 +53132,86 @@ export function bootstrap( const { status, body } = await implementation.reposSetAppAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20513,6 +53247,86 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveAppAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20543,6 +53357,61 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20578,6 +53447,75 @@ export function bootstrap( const { status, body } = await implementation.reposAddTeamAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20613,6 +53551,75 @@ export function bootstrap( const { status, body } = await implementation.reposSetTeamAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20648,6 +53655,75 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveTeamAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20678,6 +53754,48 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20713,6 +53831,62 @@ export function bootstrap( const { status, body } = await implementation.reposAddUserAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20748,6 +53922,62 @@ export function bootstrap( const { status, body } = await implementation.reposSetUserAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20783,6 +54013,62 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveUserAccessRestrictions(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20811,6 +54097,596 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + name: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + _links: z.object({ + html: z.coerce.string(), + self: z.coerce.string(), + }), + protected: z.coerce.boolean(), + protection: z.object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }), + protection_url: z.coerce.string(), + pattern: z.coerce.string().optional(), + required_approving_review_count: z.coerce.number().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20838,6 +54714,180 @@ export function bootstrap( } const { status, body } = await implementation.checksCreate(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20861,6 +54911,180 @@ export function bootstrap( } const { status, body } = await implementation.checksGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20945,6 +55169,180 @@ export function bootstrap( } const { status, body } = await implementation.checksUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -20976,6 +55374,26 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + annotation_level: z.coerce.string(), + title: z.coerce.string(), + message: z.coerce.string(), + raw_details: z.coerce.string(), + blob_href: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21002,6 +55420,44 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21029,6 +55485,569 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21065,6 +56084,186 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + preferences: z.object({ + auto_trigger_checks: z + .array( + z.object({ + app_id: z.coerce.number(), + setting: z.coerce.boolean(), + }) + ) + .optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21088,6 +56287,288 @@ export function bootstrap( } const { status, body } = await implementation.checksGetSuite(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21122,6 +56603,189 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21148,6 +56812,11 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21191,6 +56860,130 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListAlertsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + description: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21203,20 +56996,143 @@ export function bootstrap( alert_number: z.coerce.number(), }) - router.get( - "codeScanningGetAlert", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(codeScanningGetAlertParamSchema, ctx.params), - query: undefined, - body: undefined, + router.get( + "codeScanningGetAlert", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(codeScanningGetAlertParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.codeScanningGetAlert( + input, + ctx + ) + + if (status === 200) { + ctx.body = z + .object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z.enum(["none", "note", "warning", "error"]).optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) } - const { status, body } = await implementation.codeScanningGetAlert( - input, - ctx - ) ctx.status = status ctx.body = body return next() @@ -21254,6 +57170,129 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z.enum(["none", "note", "warning", "error"]).optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21290,6 +57329,72 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListAlertInstances(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21330,6 +57435,67 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListRecentAnalyses(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + ref: z.coerce.string(), + commit_sha: z.coerce.string(), + analysis_key: z.coerce.string(), + environment: z.coerce.string(), + category: z.coerce.string().optional(), + error: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + results_count: z.coerce.number(), + rules_count: z.coerce.number(), + id: z.coerce.number(), + url: z.coerce.string(), + sarif_id: z.coerce.string(), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + deletable: z.coerce.boolean(), + warning: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21359,6 +57525,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21395,6 +57598,61 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + next_analysis_url: z.coerce.string(), + confirm_delete_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21421,6 +57679,79 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListCodeqlDatabases(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + language: z.coerce.string(), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21448,6 +57779,77 @@ export function bootstrap( const { status, body } = await implementation.codeScanningGetCodeqlDatabase(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + language: z.coerce.string(), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21486,6 +57888,48 @@ export function bootstrap( input, ctx ) + + if (status === 202) { + ctx.body = z + .object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21512,6 +57956,40 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + processing_status: z + .enum(["pending", "complete", "failed"]) + .optional(), + analyses_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21541,6 +58019,25 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + errors: z.array( + z.object({ + line: z.coerce.number(), + column: z.coerce.number(), + source: z.coerce.string().optional(), + kind: z.coerce.string(), + suggestion: z.coerce.string().optional(), + message: z.coerce.string(), + path: z.coerce.string(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21578,6 +58075,350 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21623,6 +58464,643 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 202) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21659,6 +59137,78 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + devcontainers: z.array( + z.object({ + path: z.coerce.string(), + name: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21696,6 +59246,70 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + machines: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21733,6 +59347,78 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + billable_owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + defaults: z + .object({ + location: z.coerce.string(), + devcontainer_path: z.coerce.string(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21769,6 +59455,22 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21797,6 +59499,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21826,6 +59542,17 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21861,6 +59588,11 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateOrUpdateRepoSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21890,6 +59622,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -21927,6 +59660,57 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + }) + .optional(), + role_name: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -21956,6 +59740,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -21986,6 +59771,271 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22015,6 +60065,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -22042,6 +60093,59 @@ export function bootstrap( const { status, body } = await implementation.reposGetCollaboratorPermissionLevel(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + permission: z.coerce.string(), + role_name: z.coerce.string(), + user: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + }) + .optional(), + role_name: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22076,6 +60180,74 @@ export function bootstrap( const { status, body } = await implementation.reposListCommitCommentsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22102,6 +60274,83 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22135,6 +60384,83 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22164,6 +60490,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22211,6 +60549,63 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForCommitComment(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22254,6 +60649,118 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForCommitComment(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22282,6 +60789,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForCommitComment(input, ctx) + ctx.status = status ctx.body = body return next() @@ -22314,6 +60822,179 @@ export function bootstrap( } const { status, body } = await implementation.reposListCommits(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22341,6 +61022,47 @@ export function bootstrap( const { status, body } = await implementation.reposListBranchesForHeadCommit(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + protected: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22378,6 +61100,74 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22414,6 +61204,108 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22452,6 +61344,933 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22480,6 +62299,188 @@ export function bootstrap( } const { status, body } = await implementation.reposGetCommit(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22512,6 +62513,189 @@ export function bootstrap( } const { status, body } = await implementation.checksListForRef(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22548,6 +62732,293 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + check_suites: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22583,6 +63054,207 @@ export function bootstrap( const { status, body } = await implementation.reposGetCombinedStatusForRef(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + state: z.coerce.string(), + statuses: z.array( + z.object({ + description: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + context: z.coerce.string(), + target_url: z.coerce.string(), + required: z.coerce.boolean().optional(), + avatar_url: z.coerce.string(), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + sha: z.coerce.string(), + total_count: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + commit_url: z.coerce.string(), + url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22618,6 +63290,60 @@ export function bootstrap( const { status, body } = await implementation.reposListCommitStatusesForRef(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22644,6 +63370,55 @@ export function bootstrap( const { status, body } = await implementation.reposGetCommunityProfileMetrics(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + health_percentage: z.coerce.number(), + description: z.coerce.string(), + documentation: z.coerce.string(), + files: z.object({ + code_of_conduct: z.object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }), + code_of_conduct_file: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + contributing: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + readme: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + issue_template: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + pull_request_template: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + content_reports_enabled: z.coerce.boolean().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22675,6 +63450,439 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + permalink_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + base_commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + merge_base_commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + status: z.enum(["diverged", "ahead", "behind", "identical"]), + ahead_by: z.coerce.number(), + behind_by: z.coerce.number(), + total_commits: z.coerce.number(), + commits: z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22702,6 +63910,109 @@ export function bootstrap( } const { status, body } = await implementation.reposGetContent(input, ctx) + + if (status === 200) { + ctx.body = z + .union([ + z.array( + z.object({ + type: z.enum(["dir", "file", "submodule", "symlink"]), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string().optional(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + }) + ), + z.object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), + }), + z.object({ + type: z.enum(["symlink"]), + target: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + }), + z.object({ + type: z.enum(["submodule"]), + submodule_git_url: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + }), + ]) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22751,8 +64062,194 @@ export function bootstrap( ), } - const { status, body } = - await implementation.reposCreateOrUpdateFileContents(input, ctx) + const { status, body } = + await implementation.reposCreateOrUpdateFileContents(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22794,6 +64291,133 @@ export function bootstrap( } const { status, body } = await implementation.reposDeleteFile(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22825,6 +64449,59 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string(), + site_admin: z.coerce.boolean().optional(), + contributions: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22873,6 +64550,161 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22899,6 +64731,133 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ cwe_id: z.coerce.string(), name: z.coerce.string() }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22939,6 +64898,167 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ cwe_id: z.coerce.string(), name: z.coerce.string() }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -22975,6 +65095,22 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23003,6 +65139,13 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ key_id: z.coerce.string(), key: z.coerce.string() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23032,6 +65175,17 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23067,6 +65221,11 @@ export function bootstrap( const { status, body } = await implementation.dependabotCreateOrUpdateRepoSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23096,6 +65255,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -23132,6 +65292,55 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + change_type: z.enum(["added", "removed"]), + manifest: z.coerce.string(), + ecosystem: z.coerce.string(), + name: z.coerce.string(), + version: z.coerce.string(), + package_url: z.coerce.string(), + license: z.coerce.string(), + source_repository_url: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + severity: z.coerce.string(), + advisory_ghsa_id: z.coerce.string(), + advisory_summary: z.coerce.string(), + advisory_url: z.coerce.string(), + }) + ), + scope: z.enum(["unknown", "runtime", "development"]), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23180,6 +65389,18 @@ export function bootstrap( const { status, body } = await implementation.dependencyGraphCreateRepositorySnapshot(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + created_at: z.coerce.string(), + result: z.coerce.string(), + message: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23214,6 +65435,104 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23251,6 +65570,133 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 202) { + ctx.body = z + .object({ message: z.coerce.string().optional() }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23277,6 +65723,113 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23303,6 +65856,28 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23340,6 +65915,120 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23390,6 +66079,132 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23420,6 +66235,118 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23453,6 +66380,32 @@ export function bootstrap( input, ctx ) + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23486,6 +66439,35 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number().optional(), + environments: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23512,6 +66494,28 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23562,6 +66566,39 @@ export function bootstrap( const { status, body } = await implementation.reposCreateOrUpdateEnvironment(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23591,6 +66628,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -23626,6 +66664,22 @@ export function bootstrap( const { status, body } = await implementation.reposListDeploymentBranchPolicies(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + branch_policies: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23660,6 +66714,17 @@ export function bootstrap( const { status, body } = await implementation.reposCreateDeploymentBranchPolicy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23688,6 +66753,17 @@ export function bootstrap( const { status, body } = await implementation.reposGetDeploymentBranchPolicy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23723,6 +66799,17 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateDeploymentBranchPolicy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23751,6 +66838,7 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) + ctx.status = status ctx.body = body return next() @@ -23784,6 +66872,755 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23812,6 +67649,189 @@ export function bootstrap( } const { status, body } = await implementation.reposListForks(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23841,7 +67861,1171 @@ export function bootstrap( body: parseRequestInput(reposCreateForkBodySchema, ctx.body), } - const { status, body } = await implementation.reposCreateFork(input, ctx) + const { status, body } = await implementation.reposCreateFork(input, ctx) + + if (status === 202) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23869,6 +69053,71 @@ export function bootstrap( } const { status, body } = await implementation.gitCreateBlob(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ url: z.coerce.string(), sha: z.coerce.string() }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23892,6 +69141,68 @@ export function bootstrap( } const { status, body } = await implementation.gitGetBlob(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + content: z.coerce.string(), + encoding: z.coerce.string(), + url: z.coerce.string(), + sha: z.coerce.string(), + size: z.coerce.number(), + node_id: z.coerce.string(), + highlighted_content: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23935,6 +69246,79 @@ export function bootstrap( } const { status, body } = await implementation.gitCreateCommit(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + sha: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + author: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + committer: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + message: z.coerce.string(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + }) + ), + verification: z.object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + signature: z.coerce.string(), + payload: z.coerce.string(), + }), + html_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23958,6 +69342,54 @@ export function bootstrap( } const { status, body } = await implementation.gitGetCommit(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + sha: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + author: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + committer: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + message: z.coerce.string(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + }) + ), + verification: z.object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + signature: z.coerce.string(), + payload: z.coerce.string(), + }), + html_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -23984,6 +69416,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24007,6 +69457,33 @@ export function bootstrap( } const { status, body } = await implementation.gitGetRef(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24035,6 +69512,47 @@ export function bootstrap( } const { status, body } = await implementation.gitCreateRef(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24063,6 +69581,47 @@ export function bootstrap( } const { status, body } = await implementation.gitUpdateRef(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24086,6 +69645,32 @@ export function bootstrap( } const { status, body } = await implementation.gitDeleteRef(input, ctx) + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24122,6 +69707,62 @@ export function bootstrap( } const { status, body } = await implementation.gitCreateTag(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + node_id: z.coerce.string(), + tag: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + message: z.coerce.string(), + tagger: z.object({ + date: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + }), + object: z.object({ + sha: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24145,6 +69786,48 @@ export function bootstrap( } const { status, body } = await implementation.gitGetTag(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + node_id: z.coerce.string(), + tag: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + message: z.coerce.string(), + tagger: z.object({ + date: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + }), + object: z.object({ + sha: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24182,6 +69865,74 @@ export function bootstrap( } const { status, body } = await implementation.gitCreateTree(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + sha: z.coerce.string(), + url: z.coerce.string(), + truncated: z.coerce.boolean(), + tree: z.array( + z.object({ + path: z.coerce.string().optional(), + mode: z.coerce.string().optional(), + type: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24209,6 +69960,63 @@ export function bootstrap( } const { status, body } = await implementation.gitGetTree(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + sha: z.coerce.string(), + url: z.coerce.string(), + truncated: z.coerce.boolean(), + tree: z.array( + z.object({ + path: z.coerce.string().optional(), + mode: z.coerce.string().optional(), + type: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24239,6 +70047,55 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24282,6 +70139,89 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24305,6 +70245,53 @@ export function bootstrap( } const { status, body } = await implementation.reposGetWebhook(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24348,6 +70335,78 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24374,6 +70433,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24401,6 +70472,18 @@ export function bootstrap( const { status, body } = await implementation.reposGetWebhookConfigForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24440,6 +70523,18 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateWebhookConfigForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24478,6 +70573,65 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24508,6 +70662,69 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ headers: z.object({}), payload: z.object({}) }), + response: z.object({ + headers: z.object({}), + payload: z.coerce.string(), + }), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24536,6 +70753,49 @@ export function bootstrap( const { status, body } = await implementation.reposRedeliverWebhookDelivery(input, ctx) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24559,6 +70819,18 @@ export function bootstrap( } const { status, body } = await implementation.reposPingWebhook(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24585,6 +70857,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24613,6 +70897,84 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24646,6 +71008,109 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24683,6 +71148,73 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24711,6 +71243,18 @@ export function bootstrap( input, ctx ) + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24746,6 +71290,45 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24782,6 +71365,68 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24810,6 +71455,31 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + ref_name: z.coerce.string(), + path: z.coerce.string(), + oid: z.coerce.string(), + size: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24842,6 +71512,98 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24870,6 +71632,122 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24896,6 +71774,11 @@ export function bootstrap( const { status, body } = await implementation.interactionsGetRestrictionsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24936,6 +71819,21 @@ export function bootstrap( const { status, body } = await implementation.interactionsSetRestrictionsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -24962,6 +71860,7 @@ export function bootstrap( const { status, body } = await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) + ctx.status = status ctx.body = body return next() @@ -24992,6 +71891,237 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25026,6 +72156,235 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25052,6 +72411,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -25091,6 +72451,626 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25134,6 +73114,645 @@ export function bootstrap( } const { status, body } = await implementation.issuesCreate(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25173,6 +73792,158 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25196,6 +73967,131 @@ export function bootstrap( } const { status, body } = await implementation.issuesGetComment(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25224,6 +74120,145 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25250,6 +74285,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -25297,6 +74333,63 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForIssueComment(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25340,6 +74433,118 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForIssueComment(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25368,6 +74573,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForIssueComment(input, ctx) + ctx.status = status ctx.body = body return next() @@ -25401,6 +74607,867 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + actor: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25424,6 +75491,871 @@ export function bootstrap( } const { status, body } = await implementation.issuesGetEvent(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + actor: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25447,6 +76379,610 @@ export function bootstrap( } const { status, body } = await implementation.issuesGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25495,6 +77031,656 @@ export function bootstrap( } const { status, body } = await implementation.issuesUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25525,6 +77711,577 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25555,6 +78312,577 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25583,6 +78911,18 @@ export function bootstrap( const { status, body } = await implementation.issuesCheckUserCanBeAssignedToIssue(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25615,6 +78955,144 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25639,10 +79117,182 @@ export function bootstrap( body: parseRequestInput(issuesCreateCommentBodySchema, ctx.body), } - const { status, body } = await implementation.issuesCreateComment( - input, - ctx - ) + const { status, body } = await implementation.issuesCreateComment( + input, + ctx + ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25671,6 +79321,22 @@ export function bootstrap( } const { status, body } = await implementation.issuesListEvents(input, ctx) + + if (status === 200) { + ctx.body = z.array(z.object({})).parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25705,6 +79371,56 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25738,6 +79454,81 @@ export function bootstrap( } const { status, body } = await implementation.issuesAddLabels(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25771,6 +79562,81 @@ export function bootstrap( } const { status, body } = await implementation.issuesSetLabels(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25797,6 +79663,40 @@ export function bootstrap( input, ctx ) + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25824,6 +79724,56 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 301) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25855,6 +79805,65 @@ export function bootstrap( } const { status, body } = await implementation.issuesLock(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25878,6 +79887,29 @@ export function bootstrap( } const { status, body } = await implementation.issuesUnlock(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25921,6 +79953,74 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25963,6 +80063,118 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -25993,6 +80205,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -26030,6 +80243,33 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.array(z.object({})).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26060,6 +80300,25 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26091,6 +80350,48 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26117,6 +80418,34 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26143,6 +80472,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -26176,6 +80506,34 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26207,6 +80565,57 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26230,6 +80639,32 @@ export function bootstrap( } const { status, body } = await implementation.issuesGetLabel(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26264,6 +80699,21 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26290,6 +80740,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -26315,6 +80766,11 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26340,6 +80796,11 @@ export function bootstrap( input, ctx ) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26368,6 +80829,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -26393,6 +80855,38 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + size: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + git_url: z.coerce.string(), + download_url: z.coerce.string(), + type: z.coerce.string(), + content: z.coerce.string(), + encoding: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26420,6 +80914,17 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + merge_type: z.enum(["merge", "fast-forward", "none"]).optional(), + base_branch: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26445,6 +80950,164 @@ export function bootstrap( } const { status, body } = await implementation.reposMerge(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26473,10 +81136,69 @@ export function bootstrap( body: undefined, } - const { status, body } = await implementation.issuesListMilestones( - input, - ctx - ) + const { status, body } = await implementation.issuesListMilestones( + input, + ctx + ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26509,6 +81231,88 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26535,6 +81339,63 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26570,6 +81431,52 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26596,6 +81503,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26631,6 +81550,23 @@ export function bootstrap( const { status, body } = await implementation.issuesListLabelsForMilestone(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26673,6 +81609,191 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26708,6 +81829,16 @@ export function bootstrap( const { status, body } = await implementation.activityMarkRepoNotificationsAsRead(input, ctx) + + if (status === 202) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26730,6 +81861,64 @@ export function bootstrap( } const { status, body } = await implementation.reposGetPages(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + status: z.enum(["built", "building", "errored"]), + cname: z.coerce.string(), + protected_domain_state: z + .enum(["pending", "verified", "unverified"]) + .optional(), + pending_domain_unverified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + custom_404: z.coerce.boolean(), + html_url: z.coerce.string().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ branch: z.coerce.string(), path: z.coerce.string() }) + .optional(), + public: z.coerce.boolean(), + https_certificate: z + .object({ + state: z.enum([ + "new", + "authorization_created", + "authorization_pending", + "authorized", + "authorization_revoked", + "issued", + "uploaded", + "approved", + "errored", + "bad_authz", + "destroy_pending", + "dns_changed", + ]), + description: z.coerce.string(), + domains: z.array(z.coerce.string()), + expires_at: z.coerce.string().optional(), + }) + .optional(), + https_enforced: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26765,6 +81954,89 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + status: z.enum(["built", "building", "errored"]), + cname: z.coerce.string(), + protected_domain_state: z + .enum(["pending", "verified", "unverified"]) + .optional(), + pending_domain_unverified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + custom_404: z.coerce.boolean(), + html_url: z.coerce.string().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ branch: z.coerce.string(), path: z.coerce.string() }) + .optional(), + public: z.coerce.boolean(), + https_certificate: z + .object({ + state: z.enum([ + "new", + "authorization_created", + "authorization_pending", + "authorized", + "authorization_revoked", + "issued", + "uploaded", + "approved", + "errored", + "bad_authz", + "destroy_pending", + "dns_changed", + ]), + description: z.coerce.string(), + domains: z.array(z.coerce.string()), + expires_at: z.coerce.string().optional(), + }) + .optional(), + https_enforced: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26801,6 +82073,56 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateInformationAboutPagesSite(input, ctx) + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26826,6 +82148,54 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26856,6 +82226,46 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26884,6 +82294,13 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ url: z.coerce.string(), status: z.coerce.string() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26912,6 +82329,44 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26938,6 +82393,44 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -26973,6 +82466,66 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + status_url: z.coerce.string(), + page_url: z.coerce.string(), + preview_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27001,6 +82554,97 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + domain: z + .object({ + host: z.coerce.string().optional(), + uri: z.coerce.string().optional(), + nameservers: z.coerce.string().optional(), + dns_resolves: z.coerce.boolean().optional(), + is_proxied: z.coerce.boolean().optional(), + is_cloudflare_ip: z.coerce.boolean().optional(), + is_fastly_ip: z.coerce.boolean().optional(), + is_old_ip_address: z.coerce.boolean().optional(), + is_a_record: z.coerce.boolean().optional(), + has_cname_record: z.coerce.boolean().optional(), + has_mx_records_present: z.coerce.boolean().optional(), + is_valid_domain: z.coerce.boolean().optional(), + is_apex_domain: z.coerce.boolean().optional(), + should_be_a_record: z.coerce.boolean().optional(), + is_cname_to_github_user_domain: z.coerce.boolean().optional(), + is_cname_to_pages_dot_github_dot_com: z.coerce + .boolean() + .optional(), + is_cname_to_fastly: z.coerce.boolean().optional(), + is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), + is_non_github_pages_ip_present: z.coerce.boolean().optional(), + is_pages_domain: z.coerce.boolean().optional(), + is_served_by_pages: z.coerce.boolean().optional(), + is_valid: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + responds_to_https: z.coerce.boolean().optional(), + enforces_https: z.coerce.boolean().optional(), + https_error: z.coerce.string().optional(), + is_https_eligible: z.coerce.boolean().optional(), + caa_error: z.coerce.string().optional(), + }) + .optional(), + alt_domain: z + .object({ + host: z.coerce.string().optional(), + uri: z.coerce.string().optional(), + nameservers: z.coerce.string().optional(), + dns_resolves: z.coerce.boolean().optional(), + is_proxied: z.coerce.boolean().optional(), + is_cloudflare_ip: z.coerce.boolean().optional(), + is_fastly_ip: z.coerce.boolean().optional(), + is_old_ip_address: z.coerce.boolean().optional(), + is_a_record: z.coerce.boolean().optional(), + has_cname_record: z.coerce.boolean().optional(), + has_mx_records_present: z.coerce.boolean().optional(), + is_valid_domain: z.coerce.boolean().optional(), + is_apex_domain: z.coerce.boolean().optional(), + should_be_a_record: z.coerce.boolean().optional(), + is_cname_to_github_user_domain: z.coerce.boolean().optional(), + is_cname_to_pages_dot_github_dot_com: z.coerce + .boolean() + .optional(), + is_cname_to_fastly: z.coerce.boolean().optional(), + is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), + is_non_github_pages_ip_present: z.coerce.boolean().optional(), + is_pages_domain: z.coerce.boolean().optional(), + is_served_by_pages: z.coerce.boolean().optional(), + is_valid: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + responds_to_https: z.coerce.boolean().optional(), + enforces_https: z.coerce.boolean().optional(), + https_error: z.coerce.string().optional(), + is_https_eligible: z.coerce.boolean().optional(), + caa_error: z.coerce.string().optional(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27032,6 +82676,109 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27062,6 +82809,107 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 410) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27093,6 +82941,958 @@ export function bootstrap( } const { status, body } = await implementation.pullsList(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27121,6 +83921,616 @@ export function bootstrap( } const { status, body } = await implementation.pullsCreate(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27157,6 +84567,92 @@ export function bootstrap( const { status, body } = await implementation.pullsListReviewCommentsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27179,10 +84675,105 @@ export function bootstrap( body: undefined, } - const { status, body } = await implementation.pullsGetReviewComment( - input, - ctx - ) + const { status, body } = await implementation.pullsGetReviewComment( + input, + ctx + ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27216,6 +84807,90 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27245,6 +84920,18 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27295,6 +84982,63 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27341,6 +85085,118 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27369,6 +85225,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForPullRequestComment(input, ctx) + ctx.status = status ctx.body = body return next() @@ -27392,6 +85249,612 @@ export function bootstrap( } const { status, body } = await implementation.pullsGet(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27425,6 +85888,616 @@ export function bootstrap( } const { status, body } = await implementation.pullsUpdate(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27470,6 +86543,630 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 202) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27507,6 +87204,92 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27548,6 +87331,126 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27583,6 +87486,101 @@ export function bootstrap( const { status, body } = await implementation.pullsCreateReplyForReviewComment(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27611,6 +87609,133 @@ export function bootstrap( } const { status, body } = await implementation.pullsListCommits(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27639,6 +87764,81 @@ export function bootstrap( } const { status, body } = await implementation.pullsListFiles(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27665,6 +87865,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -27697,6 +87898,82 @@ export function bootstrap( } const { status, body } = await implementation.pullsMerge(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + sha: z.coerce.string(), + merged: z.coerce.boolean(), + message: z.coerce.string(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 405) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27726,6 +88003,77 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27759,6 +88107,942 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27794,6 +89078,956 @@ export function bootstrap( const { status, body } = await implementation.pullsRemoveRequestedReviewers(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27822,6 +90056,66 @@ export function bootstrap( } const { status, body } = await implementation.pullsListReviews(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27865,10 +90159,89 @@ export function bootstrap( body: parseRequestInput(pullsCreateReviewBodySchema, ctx.body), } - const { status, body } = await implementation.pullsCreateReview( - input, - ctx - ) + const { status, body } = await implementation.pullsCreateReview( + input, + ctx + ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27893,6 +90266,75 @@ export function bootstrap( } const { status, body } = await implementation.pullsGetReview(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27922,6 +90364,74 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27952,6 +90462,85 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -27990,6 +90579,103 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28022,6 +90708,85 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28054,6 +90819,96 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28084,6 +90939,52 @@ export function bootstrap( input, ctx ) + + if (status === 202) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28110,6 +91011,68 @@ export function bootstrap( } const { status, body } = await implementation.reposGetReadme(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28146,6 +91109,68 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28176,6 +91201,123 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28213,6 +91355,146 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28239,6 +91521,60 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28276,6 +91612,49 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28305,6 +91684,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -28340,6 +91720,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ name: z.coerce.string(), body: z.coerce.string() }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28365,6 +91763,110 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28391,6 +91893,121 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28414,6 +92031,121 @@ export function bootstrap( } const { status, body } = await implementation.reposGetRelease(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28453,6 +92185,121 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28479,6 +92326,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -28513,6 +92361,51 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28549,6 +92442,49 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28586,6 +92522,63 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28619,6 +92612,118 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28649,6 +92754,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -28690,6 +92796,111 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListAlertsForRepo(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28719,6 +92930,103 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + number: z.coerce.number().optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28756,6 +93064,103 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + number: z.coerce.number().optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28789,8 +93194,50 @@ export function bootstrap( body: undefined, } - const { status, body } = - await implementation.secretScanningListLocationsForAlert(input, ctx) + const { status, body } = + await implementation.secretScanningListLocationsForAlert(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + type: z.enum([ + "commit", + "issue_title", + "issue_body", + "issue_comment", + ]), + details: z.union([ + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + blob_sha: z.coerce.string(), + blob_url: z.coerce.string(), + commit_sha: z.coerce.string(), + commit_url: z.coerce.string(), + }), + z.object({ issue_title_url: z.coerce.string() }), + z.object({ issue_body_url: z.coerce.string() }), + z.object({ issue_comment_url: z.coerce.string() }), + ]), + }) + ) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28825,6 +93272,36 @@ export function bootstrap( const { status, body } = await implementation.activityListStargazersForRepo(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28853,6 +93330,15 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.array(z.array(z.coerce.number())).parse(body) + } + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28881,6 +93367,23 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + days: z.array(z.coerce.number()), + total: z.coerce.number(), + week: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28909,6 +93412,52 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + total: z.coerce.number(), + weeks: z.array( + z.object({ + w: z.coerce.number().optional(), + a: z.coerce.number().optional(), + d: z.coerce.number().optional(), + c: z.coerce.number().optional(), + }) + ), + }) + ) + .parse(body) + } + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28937,6 +93486,27 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + all: z.array(z.coerce.number()), + owner: z.array(z.coerce.number()), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -28965,6 +93535,11 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.array(z.array(z.coerce.number())).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29001,6 +93576,47 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29037,6 +93653,37 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29065,6 +93712,31 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + repository_url: z.coerce.string(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29103,6 +93775,20 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + repository_url: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29129,6 +93815,7 @@ export function bootstrap( const { status, body } = await implementation.activityDeleteRepoSubscription(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29153,6 +93840,24 @@ export function bootstrap( } const { status, body } = await implementation.reposListTags(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + zipball_url: z.coerce.string(), + tarball_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29180,6 +93885,43 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29212,6 +93954,41 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29241,6 +94018,29 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29270,6 +94070,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -29297,6 +94098,50 @@ export function bootstrap( } const { status, body } = await implementation.reposListTeams(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29327,6 +94172,22 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.object({ names: z.array(z.coerce.string()) }).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29356,6 +94217,32 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.object({ names: z.array(z.coerce.string()) }).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29382,6 +94269,34 @@ export function bootstrap( } const { status, body } = await implementation.reposGetClones(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + count: z.coerce.number(), + uniques: z.coerce.number(), + clones: z.array( + z.object({ + timestamp: z.coerce.string().datetime({ offset: true }), + uniques: z.coerce.number(), + count: z.coerce.number(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29404,6 +94319,31 @@ export function bootstrap( } const { status, body } = await implementation.reposGetTopPaths(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + path: z.coerce.string(), + title: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29429,6 +94369,30 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + referrer: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29455,6 +94419,34 @@ export function bootstrap( } const { status, body } = await implementation.reposGetViews(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + count: z.coerce.number(), + uniques: z.coerce.number(), + views: z.array( + z.object({ + timestamp: z.coerce.string().datetime({ offset: true }), + uniques: z.coerce.number(), + count: z.coerce.number(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29483,6 +94475,165 @@ export function bootstrap( } const { status, body } = await implementation.reposTransfer(input, ctx) + + if (status === 202) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29509,6 +94660,7 @@ export function bootstrap( const { status, body } = await implementation.reposCheckVulnerabilityAlerts(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29535,6 +94687,7 @@ export function bootstrap( const { status, body } = await implementation.reposEnableVulnerabilityAlerts(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29561,6 +94714,7 @@ export function bootstrap( const { status, body } = await implementation.reposDisableVulnerabilityAlerts(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29590,6 +94744,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -29626,6 +94781,309 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29644,6 +95102,192 @@ export function bootstrap( } const { status, body } = await implementation.reposListPublic(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29677,6 +95321,22 @@ export function bootstrap( const { status, body } = await implementation.actionsListEnvironmentSecrets(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29703,6 +95363,20 @@ export function bootstrap( const { status, body } = await implementation.actionsGetEnvironmentPublicKey(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29732,6 +95406,17 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29767,6 +95452,11 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateEnvironmentSecret(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29794,6 +95484,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteEnvironmentSecret(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29828,6 +95519,23 @@ export function bootstrap( const { status, body } = await implementation.actionsListEnvironmentVariables(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29862,6 +95570,11 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateEnvironmentVariable(input, ctx) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29889,6 +95602,18 @@ export function bootstrap( const { status, body } = await implementation.actionsGetEnvironmentVariable(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -29924,6 +95649,7 @@ export function bootstrap( const { status, body } = await implementation.actionsUpdateEnvironmentVariable(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29951,6 +95677,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteEnvironmentVariable(input, ctx) + ctx.status = status ctx.body = body return next() @@ -29965,14 +95692,268 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("searchCode", "/search/code", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchCodeQuerySchema, ctx.query), - body: undefined, + router.get("searchCode", "/search/code", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchCodeQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.searchCode(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + file_size: z.coerce.number().optional(), + language: z.coerce.string().optional(), + last_modified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + line_numbers: z.array(z.coerce.string()).optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) } - const { status, body } = await implementation.searchCode(input, ctx) ctx.status = status ctx.body = body return next() @@ -29994,6 +95975,268 @@ export function bootstrap( } const { status, body } = await implementation.searchCommits(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + comment_count: z.coerce.number(), + message: z.coerce.string(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + url: z.coerce.string(), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + node_id: z.coerce.string(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30038,6 +96281,620 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + title: z.coerce.string(), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + description: z.coerce.string().optional(), + }) + ), + state: z.coerce.string(), + state_reason: z.coerce.string().optional(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + comments: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + body: z.coerce.string().optional(), + score: z.coerce.number(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + draft: z.coerce.boolean().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30061,6 +96918,93 @@ export function bootstrap( } const { status, body } = await implementation.searchLabels(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + description: z.coerce.string(), + score: z.coerce.number(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30084,6 +97028,198 @@ export function bootstrap( } const { status, body } = await implementation.searchRepos(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + pushed_at: z.coerce.string().datetime({ offset: true }), + homepage: z.coerce.string(), + size: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + open_issues_count: z.coerce.number(), + master_branch: z.coerce.string().optional(), + default_branch: z.coerce.string(), + score: z.coerce.number(), + forks_url: z.coerce.string(), + keys_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + teams_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + events_url: z.coerce.string(), + assignees_url: z.coerce.string(), + branches_url: z.coerce.string(), + tags_url: z.coerce.string(), + blobs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + trees_url: z.coerce.string(), + statuses_url: z.coerce.string(), + languages_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + contributors_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + commits_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + comments_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + contents_url: z.coerce.string(), + compare_url: z.coerce.string(), + merges_url: z.coerce.string(), + archive_url: z.coerce.string(), + downloads_url: z.coerce.string(), + issues_url: z.coerce.string(), + pulls_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + labels_url: z.coerce.string(), + releases_url: z.coerce.string(), + deployments_url: z.coerce.string(), + git_url: z.coerce.string(), + ssh_url: z.coerce.string(), + clone_url: z.coerce.string(), + svn_url: z.coerce.string(), + forks: z.coerce.number(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + topics: z.array(z.coerce.string()).optional(), + mirror_url: z.coerce.string(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30103,6 +97239,79 @@ export function bootstrap( } const { status, body } = await implementation.searchTopics(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + short_description: z.coerce.string(), + description: z.coerce.string(), + created_by: z.coerce.string(), + released: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + featured: z.coerce.boolean(), + curated: z.coerce.boolean(), + score: z.coerce.number(), + repository_count: z.coerce.number().optional(), + logo_url: z.coerce.string().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + related: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + aliases: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30124,6 +97333,115 @@ export function bootstrap( } const { status, body } = await implementation.searchUsers(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + score: z.coerce.number(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + events_url: z.coerce.string(), + public_repos: z.coerce.number().optional(), + public_gists: z.coerce.number().optional(), + followers: z.coerce.number().optional(), + following: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + name: z.coerce.string().optional(), + bio: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + location: z.coerce.string().optional(), + site_admin: z.coerce.boolean(), + hireable: z.coerce.boolean().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + blog: z.coerce.string().optional(), + company: z.coerce.string().optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30139,6 +97457,125 @@ export function bootstrap( } const { status, body } = await implementation.teamsGetLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30162,6 +97599,268 @@ export function bootstrap( } const { status, body } = await implementation.teamsUpdateLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30177,6 +97876,43 @@ export function bootstrap( } const { status, body } = await implementation.teamsDeleteLegacy(input, ctx) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30212,6 +97948,69 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30248,6 +98047,67 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30276,6 +98136,67 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30314,6 +98235,67 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30342,6 +98324,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -30377,6 +98360,64 @@ export function bootstrap( const { status, body } = await implementation.teamsListDiscussionCommentsLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30410,6 +98451,62 @@ export function bootstrap( const { status, body } = await implementation.teamsCreateDiscussionCommentLegacy(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30437,6 +98534,62 @@ export function bootstrap( const { status, body } = await implementation.teamsGetDiscussionCommentLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30471,6 +98624,62 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateDiscussionCommentLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30498,6 +98707,7 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) + ctx.status = status ctx.body = body return next() @@ -30548,6 +98758,52 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30594,6 +98850,50 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30640,6 +98940,52 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForTeamDiscussionLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30682,6 +99028,50 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForTeamDiscussionLegacy(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30715,6 +99105,50 @@ export function bootstrap( const { status, body } = await implementation.teamsListPendingInvitationsLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30744,10 +99178,52 @@ export function bootstrap( body: undefined, } - const { status, body } = await implementation.teamsListMembersLegacy( - input, - ctx - ) + const { status, body } = await implementation.teamsListMembersLegacy( + input, + ctx + ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30773,6 +99249,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -30798,6 +99275,18 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30826,6 +99315,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -30852,6 +99342,28 @@ export function bootstrap( const { status, body } = await implementation.teamsGetMembershipForUserLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30885,6 +99397,28 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateMembershipForUserLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30911,6 +99445,7 @@ export function bootstrap( const { status, body } = await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) + ctx.status = status ctx.body = body return next() @@ -30943,6 +99478,69 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -30969,6 +99567,56 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForProjectLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31005,6 +99653,52 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31033,6 +99727,43 @@ export function bootstrap( input, ctx ) + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31062,6 +99793,187 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31089,6 +100001,441 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForRepoLegacy(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31123,6 +100470,43 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateRepoPermissionsLegacy(input, ctx) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31149,6 +100533,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -31178,6 +100563,97 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31195,6 +100671,141 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .union([ + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), + }), + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }), + ]) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31224,6 +100835,121 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce.string().datetime({ offset: true }).optional(), + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31249,6 +100975,70 @@ export function bootstrap( const { status, body } = await implementation.usersListBlockedByAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31271,6 +101061,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31287,6 +101111,65 @@ export function bootstrap( } const { status, body } = await implementation.usersBlock(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31302,6 +101185,40 @@ export function bootstrap( } const { status, body } = await implementation.usersUnblock(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31328,6 +101245,350 @@ export function bootstrap( const { status, body } = await implementation.codespacesListForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31376,6 +101637,630 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 202) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 503) { + ctx.body = z + .object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31405,6 +102290,24 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), + }) + ), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31426,6 +102329,13 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ key_id: z.coerce.string(), key: z.coerce.string() }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31451,6 +102361,19 @@ export function bootstrap( const { status, body } = await implementation.codespacesGetSecretForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31489,6 +102412,47 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z.object({}).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31517,6 +102481,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -31544,6 +102509,223 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31577,6 +102759,51 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31607,6 +102834,51 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31637,6 +102909,51 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31662,6 +102979,341 @@ export function bootstrap( const { status, body } = await implementation.codespacesGetForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31698,6 +103350,330 @@ export function bootstrap( const { status, body } = await implementation.codespacesUpdateForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31723,6 +103699,55 @@ export function bootstrap( const { status, body } = await implementation.codespacesDeleteForAuthenticatedUser(input, ctx) + + if (status === 202) { + ctx.body = z.object({}).parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31748,6 +103773,93 @@ export function bootstrap( const { status, body } = await implementation.codespacesExportForAuthenticatedUser(input, ctx) + + if (status === 202) { + ctx.body = z + .object({ + state: z.coerce.string().optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + branch: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + id: z.coerce.string().optional(), + export_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31777,6 +103889,35 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + state: z.coerce.string().optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + branch: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + id: z.coerce.string().optional(), + export_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31805,6 +103946,70 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + machines: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31838,6 +104043,1290 @@ export function bootstrap( const { status, body } = await implementation.codespacesPublishForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31863,31 +105352,736 @@ export function bootstrap( const { status, body } = await implementation.codespacesStartForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 402) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() } ) - const codespacesStopForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) + const codespacesStopForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + router.post( + "codespacesStopForAuthenticatedUser", + "/user/codespaces/:codespaceName/stop", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesStopForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesStopForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } - router.post( - "codespacesStopForAuthenticatedUser", - "/user/codespaces/:codespaceName/stop", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesStopForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, + if (status === 500) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) } - const { status, body } = - await implementation.codespacesStopForAuthenticatedUser(input, ctx) ctx.status = status ctx.body = body return next() @@ -31916,6 +106110,78 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31942,6 +106208,53 @@ export function bootstrap( const { status, body } = await implementation.usersListEmailsForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31969,6 +106282,78 @@ export function bootstrap( const { status, body } = await implementation.usersAddEmailForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -31996,6 +106381,65 @@ export function bootstrap( const { status, body } = await implementation.usersDeleteEmailForAuthenticatedUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32022,6 +106466,59 @@ export function bootstrap( const { status, body } = await implementation.usersListFollowersForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32048,6 +106545,59 @@ export function bootstrap( const { status, body } = await implementation.usersListFollowedByAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32076,6 +106626,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32092,6 +106676,40 @@ export function bootstrap( } const { status, body } = await implementation.usersFollow(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32110,6 +106728,40 @@ export function bootstrap( } const { status, body } = await implementation.usersUnfollow(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32136,6 +106788,86 @@ export function bootstrap( const { status, body } = await implementation.usersListGpgKeysForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32162,6 +106894,109 @@ export function bootstrap( const { status, body } = await implementation.usersCreateGpgKeyForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32187,6 +107022,84 @@ export function bootstrap( const { status, body } = await implementation.usersGetGpgKeyForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32212,6 +107125,65 @@ export function bootstrap( const { status, body } = await implementation.usersDeleteGpgKeyForAuthenticatedUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32241,6 +107213,133 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + installations: z.array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32277,6 +107376,339 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + total_count: z.coerce.number(), + repository_selection: z.coerce.string().optional(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32306,6 +107738,29 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32336,6 +107791,29 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32357,6 +107835,11 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32392,6 +107875,46 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32413,6 +107936,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -32445,8 +107969,592 @@ export function bootstrap( body: undefined, } - const { status, body } = - await implementation.issuesListForAuthenticatedUser(input, ctx) + const { status, body } = + await implementation.issuesListForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32476,6 +108584,56 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32505,6 +108663,79 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32533,6 +108764,54 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32561,6 +108840,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32590,6 +108903,71 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + billing_cycle: z.coerce.string(), + next_billing_date: z.coerce.string().datetime({ offset: true }), + unit_count: z.coerce.number(), + on_free_trial: z.coerce.boolean(), + free_trial_ends_on: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + account: z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + type: z.coerce.string(), + node_id: z.coerce.string().optional(), + login: z.coerce.string(), + email: z.coerce.string().email().optional(), + organization_billing_email: z.coerce + .string() + .email() + .optional(), + }), + plan: z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32619,6 +108997,60 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + billing_cycle: z.coerce.string(), + next_billing_date: z.coerce.string().datetime({ offset: true }), + unit_count: z.coerce.number(), + on_free_trial: z.coerce.boolean(), + free_trial_ends_on: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + account: z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + type: z.coerce.string(), + node_id: z.coerce.string().optional(), + login: z.coerce.string(), + email: z.coerce.string().email().optional(), + organization_billing_email: z.coerce + .string() + .email() + .optional(), + }), + plan: z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32646,6 +109078,107 @@ export function bootstrap( const { status, body } = await implementation.orgsListMembershipsForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32671,6 +109204,80 @@ export function bootstrap( const { status, body } = await implementation.orgsGetMembershipForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32706,6 +109313,105 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32732,6 +109438,378 @@ export function bootstrap( const { status, body } = await implementation.migrationsListForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32765,6 +109843,401 @@ export function bootstrap( const { status, body } = await implementation.migrationsStartForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32797,6 +110270,387 @@ export function bootstrap( const { status, body } = await implementation.migrationsGetStatusForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32825,6 +110679,29 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32853,6 +110730,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32882,6 +110793,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32915,6 +110860,187 @@ export function bootstrap( const { status, body } = await implementation.migrationsListReposForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32941,6 +111067,50 @@ export function bootstrap( const { status, body } = await implementation.orgsListForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -32977,6 +111147,221 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33010,6 +111395,219 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33046,6 +111644,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33089,6 +111721,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33131,11 +111797,85 @@ export function bootstrap( body: undefined, } - const { status, body } = - await implementation.packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser( - input, - ctx - ) + const { status, body } = + await implementation.packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser( + input, + ctx + ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33173,6 +111913,42 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce.string().datetime({ offset: true }).optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33210,6 +111986,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33249,6 +112059,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33275,6 +112119,85 @@ export function bootstrap( const { status, body } = await implementation.projectsCreateForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33304,6 +112227,53 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33337,6 +112307,358 @@ export function bootstrap( const { status, body } = await implementation.reposListForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33388,6 +112710,380 @@ export function bootstrap( const { status, body } = await implementation.reposCreateForAuthenticatedUser(input, ctx) + + if (status === 201) { + ctx.body = z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .parse(body) + } + + if (status === 400) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33417,6 +113113,270 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33445,6 +113405,40 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33473,6 +113467,40 @@ export function bootstrap( input, ctx ) + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 409) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33502,6 +113530,53 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33531,6 +113606,76 @@ export function bootstrap( input, ctx ) + + if (status === 201) { + ctx.body = z + .object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33559,6 +113704,51 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33587,6 +113777,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33618,6 +113842,338 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + starred_at: z.coerce.string().datetime({ offset: true }), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33647,6 +114203,40 @@ export function bootstrap( input, ctx ) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33673,6 +114263,40 @@ export function bootstrap( const { status, body } = await implementation.activityStarRepoForAuthenticatedUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33699,6 +114323,40 @@ export function bootstrap( const { status, body } = await implementation.activityUnstarRepoForAuthenticatedUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33728,6 +114386,198 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33752,8 +114602,140 @@ export function bootstrap( body: undefined, } - const { status, body } = - await implementation.teamsListForAuthenticatedUser(input, ctx) + const { status, body } = + await implementation.teamsListForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + ) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33773,6 +114755,37 @@ export function bootstrap( } const { status, body } = await implementation.usersList(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33790,6 +114803,130 @@ export function bootstrap( } const { status, body } = await implementation.usersGetByUsername(input, ctx) + + if (status === 200) { + ctx.body = z + .union([ + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), + }), + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }), + ]) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33822,6 +114959,755 @@ export function bootstrap( const { status, body } = await implementation.activityListEventsForAuthenticatedUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33859,6 +115745,755 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33892,6 +116527,755 @@ export function bootstrap( const { status, body } = await implementation.activityListPublicEventsForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33927,6 +117311,37 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33962,6 +117377,37 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -33990,6 +117436,7 @@ export function bootstrap( input, ctx ) + ctx.status = status ctx.body = body return next() @@ -34015,6 +117462,107 @@ export function bootstrap( } const { status, body } = await implementation.gistsListForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34047,6 +117595,53 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34081,6 +117676,56 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + contexts: z.array( + z.object({ + message: z.coerce.string(), + octicon: z.coerce.string(), + }) + ), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34108,6 +117753,100 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34143,6 +117882,13 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array(z.object({ id: z.coerce.number(), key: z.coerce.string() })) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34164,6 +117910,28 @@ export function bootstrap( } const { status, body } = await implementation.orgsListForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34205,6 +117973,243 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34241,6 +118246,219 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34275,6 +118493,40 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageForUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34316,6 +118568,40 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageForUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34354,6 +118640,80 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34389,6 +118749,42 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageVersionForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce.string().datetime({ offset: true }).optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34424,6 +118820,40 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageVersionForUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34459,6 +118889,40 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageVersionForUser(input, ctx) + + if (status === 401) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 403) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34489,6 +118953,80 @@ export function bootstrap( input, ctx ) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ) + .parse(body) + } + + if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34522,6 +119060,755 @@ export function bootstrap( const { status, body } = await implementation.activityListReceivedEventsForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34555,6 +119842,755 @@ export function bootstrap( const { status, body } = await implementation.activityListReceivedPublicEventsForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34582,6 +120618,176 @@ export function bootstrap( } const { status, body } = await implementation.reposListForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34607,6 +120813,34 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubActionsBillingUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_minutes_used: z.coerce.number(), + total_paid_minutes_used: z.coerce.number(), + included_minutes: z.coerce.number(), + minutes_used_breakdown: z.object({ + UBUNTU: z.coerce.number().optional(), + MACOS: z.coerce.number().optional(), + WINDOWS: z.coerce.number().optional(), + ubuntu_4_core: z.coerce.number().optional(), + ubuntu_8_core: z.coerce.number().optional(), + ubuntu_16_core: z.coerce.number().optional(), + ubuntu_32_core: z.coerce.number().optional(), + ubuntu_64_core: z.coerce.number().optional(), + windows_4_core: z.coerce.number().optional(), + windows_8_core: z.coerce.number().optional(), + windows_16_core: z.coerce.number().optional(), + windows_32_core: z.coerce.number().optional(), + windows_64_core: z.coerce.number().optional(), + macos_12_core: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34632,6 +120866,17 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubPackagesBillingUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + total_gigabytes_bandwidth_used: z.coerce.number(), + total_paid_gigabytes_bandwidth_used: z.coerce.number(), + included_gigabytes_bandwidth: z.coerce.number(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34657,6 +120902,17 @@ export function bootstrap( const { status, body } = await implementation.billingGetSharedStorageBillingUser(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + days_left_in_billing_cycle: z.coerce.number(), + estimated_paid_storage_for_month: z.coerce.number(), + estimated_storage_for_month: z.coerce.number(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34690,6 +120946,20 @@ export function bootstrap( const { status, body } = await implementation.usersListSshSigningKeysForUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34725,6 +120995,11 @@ export function bootstrap( const { status, body } = await implementation.activityListReposStarredByUser(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34758,6 +121033,176 @@ export function bootstrap( const { status, body } = await implementation.activityListReposWatchedByUser(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34772,6 +121217,22 @@ export function bootstrap( } const { status, body } = await implementation.metaGetAllVersions(input, ctx) + + if (status === 200) { + ctx.body = z.array(z.coerce.string()).parse(body) + } + + if (status === 404) { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -34785,6 +121246,11 @@ export function bootstrap( } const { status, body } = await implementation.metaGetZen(input, ctx) + + if (status === 200) { + ctx.body = z.coerce.string().parse(body) + } + ctx.status = status ctx.body = body return next() diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts index 5d1d97824..dbebba113 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts @@ -67,6 +67,15 @@ export function bootstrap( } const { status, body } = await implementation.findPets(input, ctx) + + if (status === 200) { + ctx.body = z.array(z.object({})).parse(body) + } + + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) + ctx.status = status ctx.body = body return next() @@ -85,6 +94,15 @@ export function bootstrap( } const { status, body } = await implementation.addPet(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) + ctx.status = status ctx.body = body return next() @@ -100,6 +118,15 @@ export function bootstrap( } const { status, body } = await implementation.findPetById(input, ctx) + + if (status === 200) { + ctx.body = z.object({}).parse(body) + } + + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) + ctx.status = status ctx.body = body return next() @@ -115,6 +142,11 @@ export function bootstrap( } const { status, body } = await implementation.deletePet(input, ctx) + + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) + ctx.status = status ctx.body = body return next() diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts index 1dcae998d..8c413857c 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts @@ -72,6 +72,22 @@ export function bootstrap( } const { status, body } = await implementation.getTodoLists(input, ctx) + + if (status === 200) { + ctx.body = z + .array( + z.object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }) + ) + .parse(body) + } + ctx.status = status ctx.body = body return next() @@ -87,6 +103,27 @@ export function bootstrap( } const { status, body } = await implementation.getTodoListById(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + ctx.body = z + .object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }) + .parse(body) + ctx.status = status ctx.body = body return next() @@ -104,6 +141,27 @@ export function bootstrap( } const { status, body } = await implementation.updateTodoListById(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } + + ctx.body = z + .object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }) + .parse(body) + ctx.status = status ctx.body = body return next() @@ -119,6 +177,14 @@ export function bootstrap( } const { status, body } = await implementation.deleteTodoListById(input, ctx) + + ctx.body = z + .object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }) + .parse(body) + ctx.status = status ctx.body = body return next() diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index b4964d211..aa5e8a2d1 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -64,7 +64,6 @@ export class ServerBuilder { const schemaBuilder = this.schemaBuilder const pathParams = operation.parameters.filter(it => it.in === "path") - const paramSchema = pathParams.length ? schemaBuilder.fromParameters(pathParams) : undefined let pathParamsType = "void" @@ -118,6 +117,29 @@ export class ServerBuilder { } const {status, body} = await implementation.${operation.operationId}(input, ctx) + + ${ + Object.entries(operation.responses ?? []).map(([status, response]) => { + const content = Object.values(response.content ?? {}).pop() + + if (/^\d+$/.test(status) && content) { + return ` + if(status === ${ status }) { + ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body) + } + ` + } else if (/^\dxx$/.test(status) && content) { + return ` + if(status >= ${ status[0] }00 && status < ${ status[0] + 1 }00){ + ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body) + } + ` + } else if (content) { + return `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)` + } + }).join("\n") + } + ctx.status = status ctx.body = body return next(); From 63c829ec2f67a8592ff2010b5bcd7399d6819619 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Mon, 6 Feb 2023 19:08:16 +0000 Subject: [PATCH 02/10] fix: output valid code --- .../src/api.github.com.yaml/generated.ts | 5103 ++++------------- .../src/petstore-expanded.yml/generated.ts | 28 +- .../src/todo-lists.yml/generated.ts | 32 +- .../typescript/common/typescript-common.ts | 22 +- .../typescript-koa.generator.ts | 25 +- 5 files changed, 1229 insertions(+), 3981 deletions(-) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts index 1c4593d3c..4638a3203 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts @@ -8450,7 +8450,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -8519,7 +8518,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -8547,9 +8545,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -8558,9 +8554,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -8571,7 +8565,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -8603,7 +8596,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -8643,7 +8635,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -8690,9 +8681,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -8703,9 +8692,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -8731,7 +8718,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -8780,9 +8766,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -8793,9 +8777,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -8821,7 +8803,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -8848,9 +8829,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -8861,9 +8840,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -8889,7 +8866,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9016,7 +8992,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9131,9 +9106,7 @@ export function bootstrap( contact_email: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -9145,7 +9118,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9184,7 +9156,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9625,9 +9596,7 @@ export function bootstrap( single_file_paths: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -9636,9 +9605,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -9647,9 +9614,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -9658,9 +9623,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -9686,7 +9649,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9725,7 +9687,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9764,7 +9725,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9821,7 +9781,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -9972,9 +9931,7 @@ export function bootstrap( expires_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -9983,8 +9940,230 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) + } else if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + ctx.status = status + return next() + } + ) + + const appsResetTokenParamSchema = z.object({ client_id: z.coerce.string() }) + + const appsResetTokenBodySchema = z.object({ access_token: z.coerce.string() }) + + router.patch( + "appsResetToken", + "/applications/:clientId/token", + async (ctx, next) => { + const input = { + params: parseRequestInput(appsResetTokenParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(appsResetTokenBodySchema, ctx.body), + } + + const { status, body } = await implementation.appsResetToken(input, ctx) + + if (status === 200) { + ctx.body = z + .object({ + id: z.coerce.number(), + url: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }) + .parse(body) + } else if (status === 422) { + ctx.body = z + .object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }) + .parse(body) + } + + ctx.status = status + return next() + } + ) + + const appsDeleteTokenParamSchema = z.object({ client_id: z.coerce.string() }) + + const appsDeleteTokenBodySchema = z.object({ + access_token: z.coerce.string(), + }) + + router.delete( + "appsDeleteToken", + "/applications/:clientId/token", + async (ctx, next) => { + const input = { + params: parseRequestInput(appsDeleteTokenParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(appsDeleteTokenBodySchema, ctx.body), } + const { status, body } = await implementation.appsDeleteToken(input, ctx) + if (status === 422) { ctx.body = z .object({ @@ -10011,235 +10190,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body - return next() - } - ) - - const appsResetTokenParamSchema = z.object({ client_id: z.coerce.string() }) - - const appsResetTokenBodySchema = z.object({ access_token: z.coerce.string() }) - - router.patch( - "appsResetToken", - "/applications/:clientId/token", - async (ctx, next) => { - const input = { - params: parseRequestInput(appsResetTokenParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(appsResetTokenBodySchema, ctx.body), - } - - const { status, body } = await implementation.appsResetToken(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - ctx.body = body - return next() - } - ) - - const appsDeleteTokenParamSchema = z.object({ client_id: z.coerce.string() }) - - const appsDeleteTokenBodySchema = z.object({ - access_token: z.coerce.string(), - }) - - router.delete( - "appsDeleteToken", - "/applications/:clientId/token", - async (ctx, next) => { - const input = { - params: parseRequestInput(appsDeleteTokenParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(appsDeleteTokenBodySchema, ctx.body), - } - - const { status, body } = await implementation.appsDeleteToken(input, ctx) - - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - ctx.body = body return next() } ) @@ -10433,9 +10383,7 @@ export function bootstrap( expires_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -10444,9 +10392,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -10455,9 +10401,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -10466,9 +10410,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -10494,7 +10436,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -10560,9 +10501,7 @@ export function bootstrap( pem: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -10571,9 +10510,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -10585,7 +10522,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -10617,7 +10553,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -10652,9 +10587,7 @@ export function bootstrap( html_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -10666,7 +10599,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -10685,7 +10617,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -10712,7 +10643,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -10772,7 +10702,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -10831,7 +10760,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -10879,7 +10807,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -10911,7 +10838,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -10943,7 +10869,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -10971,7 +10896,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -11011,9 +10935,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -11025,7 +10947,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -11071,9 +10992,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -11082,9 +11001,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -11095,7 +11012,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -11134,9 +11050,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -11148,7 +11062,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -11205,7 +11118,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -11425,9 +11337,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -11436,9 +11346,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -11447,9 +11355,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -11460,7 +11366,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -11663,9 +11568,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -11674,9 +11577,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -11687,7 +11588,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -11734,7 +11634,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -12486,9 +12385,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -12497,9 +12394,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -12510,7 +12405,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -12577,7 +12471,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -12669,9 +12562,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -12683,7 +12574,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -12932,9 +12822,7 @@ export function bootstrap( truncated: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -12943,9 +12831,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -12954,9 +12840,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -12982,7 +12866,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -13074,9 +12957,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13085,9 +12966,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -13113,7 +12992,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -13205,9 +13083,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13216,9 +13092,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13230,7 +13104,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -13475,9 +13348,7 @@ export function bootstrap( truncated: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ block: z @@ -13491,9 +13362,7 @@ export function bootstrap( documentation_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13505,7 +13374,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -13755,9 +13623,7 @@ export function bootstrap( truncated: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13766,9 +13632,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -13794,7 +13658,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -13818,9 +13681,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13832,7 +13693,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -13904,9 +13764,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13915,9 +13773,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -13929,7 +13785,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -13997,9 +13852,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14008,9 +13861,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14022,7 +13873,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -14088,9 +13938,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ block: z @@ -14104,9 +13952,7 @@ export function bootstrap( documentation_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14118,7 +13964,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -14189,9 +14034,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14203,7 +14046,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -14237,9 +14079,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14251,7 +14091,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -14313,9 +14152,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14324,9 +14161,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14338,7 +14173,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -14591,9 +14425,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14602,9 +14434,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14616,7 +14446,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -14702,9 +14531,7 @@ export function bootstrap( history: z.array(z.object({})).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14713,9 +14540,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14724,9 +14549,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -14752,7 +14575,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -14784,14 +14606,11 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z.object({}).parse(body) } ctx.status = status - ctx.body = body return next() } ) @@ -14816,9 +14635,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14830,7 +14647,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -14854,9 +14670,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -14868,7 +14682,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -15116,9 +14929,7 @@ export function bootstrap( truncated: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -15127,9 +14938,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -15138,9 +14947,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -15166,7 +14973,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -15190,7 +14996,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -15219,7 +15024,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -15553,9 +15357,7 @@ export function bootstrap( repository_selection: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -15564,9 +15366,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -15578,7 +15378,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -15597,7 +15396,6 @@ export function bootstrap( await implementation.appsRevokeInstallationAccessToken(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -16198,9 +15996,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16209,9 +16005,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -16237,7 +16031,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -16278,7 +16071,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -16311,9 +16103,7 @@ export function bootstrap( featured: z.coerce.boolean(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16322,9 +16112,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16336,7 +16124,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -16360,7 +16147,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -16380,7 +16166,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -16466,9 +16251,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16477,9 +16260,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16491,7 +16272,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -16533,9 +16313,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16544,9 +16322,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16558,7 +16334,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -16656,9 +16431,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16667,9 +16440,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16678,9 +16449,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -16706,7 +16475,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -16796,9 +16564,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16810,7 +16576,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -16855,9 +16620,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16869,7 +16632,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -16968,9 +16730,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -16982,7 +16742,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -17023,7 +16782,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -17802,9 +17560,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -17813,9 +17569,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -17824,9 +17578,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -17838,7 +17590,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18053,9 +17804,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18064,9 +17813,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18075,9 +17822,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -18103,7 +17848,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18135,9 +17879,7 @@ export function bootstrap( ctx.body = z .object({ message: z.coerce.string().optional() }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18146,9 +17888,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18160,7 +17900,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18364,9 +18103,7 @@ export function bootstrap( subscription_url: z.coerce.string(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18375,9 +18112,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18389,7 +18124,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18428,7 +18162,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18468,9 +18201,7 @@ export function bootstrap( repository_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18479,9 +18210,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18493,7 +18222,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18537,9 +18265,7 @@ export function bootstrap( repository_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18548,9 +18274,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18562,7 +18286,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18596,9 +18319,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18610,7 +18331,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -18633,7 +18353,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -18673,7 +18392,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -18779,9 +18497,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18793,7 +18509,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -18951,9 +18666,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -18962,9 +18675,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .union([ z.object({ @@ -18997,7 +18708,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -19031,7 +18741,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19080,7 +18789,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19112,7 +18820,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19146,9 +18853,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -19157,9 +18862,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -19171,7 +18874,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19213,7 +18915,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19250,7 +18951,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -19596,7 +19296,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19630,7 +19329,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -19658,7 +19356,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -19686,7 +19383,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -19722,7 +19418,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19759,7 +19454,6 @@ export function bootstrap( await implementation.actionsSetAllowedActionsOrganization(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -19796,7 +19490,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -19835,7 +19528,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -20052,7 +19744,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -20263,9 +19954,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -20276,7 +19965,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -20483,7 +20171,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -20695,9 +20382,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -20708,7 +20393,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -20735,7 +20419,6 @@ export function bootstrap( await implementation.actionsDeleteRequiredWorkflow(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -21074,7 +20757,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21111,7 +20793,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21142,7 +20823,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21173,7 +20853,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21234,7 +20913,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21295,7 +20973,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21341,7 +21018,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21401,7 +21077,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21431,7 +21106,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21642,7 +21316,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21679,7 +21352,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21711,7 +21383,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21773,7 +21444,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21810,7 +21480,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21838,7 +21507,6 @@ export function bootstrap( await implementation.actionsAddSelfHostedRunnerToGroupForOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -21869,7 +21537,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -21927,7 +21594,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -21968,7 +21634,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22309,7 +21974,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22650,7 +22314,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22696,7 +22359,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22723,7 +22385,6 @@ export function bootstrap( await implementation.actionsDeleteSelfHostedRunnerFromOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -22765,9 +22426,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -22779,7 +22438,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22828,9 +22486,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -22839,9 +22495,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -22852,7 +22506,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22901,9 +22554,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -22912,9 +22563,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -22925,7 +22574,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -22965,9 +22613,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -22979,7 +22625,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23023,9 +22668,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -23034,9 +22677,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -23047,7 +22688,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23092,7 +22732,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23131,7 +22770,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23169,7 +22807,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23210,7 +22847,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23239,7 +22875,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -23446,7 +23081,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23480,7 +23114,6 @@ export function bootstrap( await implementation.actionsSetSelectedReposForOrgSecret(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -23508,7 +23141,6 @@ export function bootstrap( await implementation.actionsAddSelectedRepoToOrgSecret(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -23536,7 +23168,6 @@ export function bootstrap( await implementation.actionsRemoveSelectedRepoFromOrgSecret(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -23587,7 +23218,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23626,7 +23256,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23665,7 +23294,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23701,7 +23329,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -23730,7 +23357,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -23937,7 +23563,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -23971,7 +23596,6 @@ export function bootstrap( await implementation.actionsSetSelectedReposForOrgVariable(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -23999,7 +23623,6 @@ export function bootstrap( await implementation.actionsAddSelectedRepoToOrgVariable(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -24030,7 +23653,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -24085,7 +23707,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -24121,7 +23742,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -24169,7 +23789,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -24192,7 +23811,6 @@ export function bootstrap( const { status, body } = await implementation.orgsUnblockUser(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -24400,9 +24018,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -24411,9 +24027,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -24424,7 +24038,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -24754,9 +24367,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -24765,9 +24376,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -24776,9 +24385,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -24787,9 +24394,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -24801,7 +24406,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -24848,9 +24452,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -24873,9 +24475,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -24887,7 +24487,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -24940,7 +24539,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -24981,7 +24579,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25022,7 +24619,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25060,9 +24656,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -25071,9 +24665,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -25099,7 +24691,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25139,7 +24730,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25343,9 +24933,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -25357,7 +24945,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25402,7 +24989,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25438,9 +25024,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -25466,7 +25050,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25505,9 +25088,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -25533,7 +25114,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25755,9 +25335,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -25768,9 +25346,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -25779,9 +25355,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -25790,9 +25364,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -25803,7 +25375,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25856,7 +25427,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25890,7 +25460,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25931,7 +25500,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -25972,7 +25540,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -26001,7 +25568,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -26208,7 +25774,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -26242,7 +25807,6 @@ export function bootstrap( await implementation.dependabotSetSelectedReposForOrgSecret(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -26270,7 +25834,6 @@ export function bootstrap( await implementation.dependabotAddSelectedRepoToOrgSecret(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -26301,7 +25864,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -27085,7 +26647,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27161,9 +26722,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27175,7 +26734,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27219,9 +26777,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27233,7 +26789,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -27283,9 +26838,7 @@ export function bootstrap( type: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27294,9 +26847,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -27322,7 +26873,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -27364,9 +26914,7 @@ export function bootstrap( type: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27378,7 +26926,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27440,9 +26987,7 @@ export function bootstrap( type: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27451,9 +26996,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -27479,7 +27022,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27516,7 +27058,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27556,7 +27097,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27606,7 +27146,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27661,9 +27200,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27674,9 +27211,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -27702,7 +27237,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27753,9 +27287,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27766,9 +27298,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -27794,7 +27324,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27823,9 +27352,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -27836,9 +27363,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -27864,7 +27389,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -27898,7 +27422,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28017,7 +27540,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28157,7 +27679,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28187,7 +27708,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28238,9 +27758,7 @@ export function bootstrap( expires_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -28266,7 +27784,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28292,7 +27809,6 @@ export function bootstrap( await implementation.interactionsRemoveRestrictionsForOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -28368,9 +27884,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -28382,7 +27896,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28452,9 +27965,7 @@ export function bootstrap( invitation_source: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -28463,9 +27974,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -28491,7 +28000,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28525,9 +28033,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -28553,7 +28059,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -28627,9 +28132,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -28641,7 +28144,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -29240,9 +28742,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29254,7 +28754,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -29304,9 +28803,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -29332,7 +28829,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -29360,7 +28856,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -29394,7 +28889,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -29725,9 +29219,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29736,9 +29228,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29747,9 +29237,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29758,9 +29246,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29772,7 +29258,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -29801,9 +29286,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29812,9 +29295,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29823,9 +29304,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29834,9 +29313,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -29848,7 +29325,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -30163,9 +29639,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30174,9 +29648,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30185,9 +29657,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30196,9 +29666,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30210,7 +29678,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -30287,9 +29754,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30298,9 +29763,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30312,7 +29775,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -30393,9 +29855,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30404,9 +29864,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -30432,7 +29890,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -30469,9 +29926,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -30483,7 +29938,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -30861,7 +30315,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -31240,9 +30693,7 @@ export function bootstrap( exclude: z.array(z.object({})).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -31251,9 +30702,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -31279,7 +30728,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -31659,9 +31107,7 @@ export function bootstrap( exclude: z.array(z.object({})).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -31673,7 +31119,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -31711,7 +31156,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -31749,7 +31193,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -31790,7 +31233,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -31993,9 +31435,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32007,7 +31447,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32072,7 +31511,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32107,9 +31545,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32121,7 +31557,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32157,7 +31592,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32409,9 +31843,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32420,9 +31852,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32434,7 +31864,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32681,7 +32110,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32726,9 +32154,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32737,9 +32163,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32751,7 +32175,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32801,9 +32224,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32812,9 +32233,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32826,7 +32245,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -32914,9 +32332,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32925,9 +32341,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32936,9 +32350,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -32950,7 +32362,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33024,7 +32435,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33068,9 +32478,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33079,9 +32487,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33093,7 +32499,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33137,9 +32542,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33148,9 +32551,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33162,7 +32563,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33230,9 +32630,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -33243,7 +32641,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -33313,9 +32710,7 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33324,9 +32719,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33335,9 +32728,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33346,9 +32737,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -33357,9 +32746,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -33370,7 +32757,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33428,7 +32814,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33455,7 +32840,6 @@ export function bootstrap( await implementation.orgsCheckPublicMembershipForUser(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -33496,7 +32880,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -33526,7 +32909,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -33713,7 +33095,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -34057,9 +33438,7 @@ export function bootstrap( anonymous_access_enabled: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -34068,9 +33447,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -34096,7 +33473,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -34299,9 +33675,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -34310,9 +33684,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -34323,7 +33695,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -34370,7 +33741,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -34399,7 +33769,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -34426,7 +33795,6 @@ export function bootstrap( await implementation.orgsRemoveSecurityManagerTeam(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -34479,7 +33847,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -34515,7 +33882,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -34551,7 +33917,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -34613,9 +33978,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -34627,7 +33990,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -34757,9 +34119,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -34768,9 +34128,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -34796,7 +34154,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -34922,9 +34279,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -34936,7 +34291,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35073,9 +34427,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -35180,9 +34532,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -35191,9 +34541,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -35202,9 +34550,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -35230,7 +34576,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35253,7 +34598,6 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteInOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -35354,7 +34698,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35449,7 +34792,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35539,7 +34881,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35636,7 +34977,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35666,7 +35006,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -35760,7 +35099,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35850,7 +35188,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -35934,7 +35271,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36025,7 +35361,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36054,7 +35389,6 @@ export function bootstrap( await implementation.teamsDeleteDiscussionCommentInOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -36151,7 +35485,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36239,9 +35572,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -36285,7 +35616,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36315,7 +35645,6 @@ export function bootstrap( await implementation.reactionsDeleteForTeamDiscussionComment(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -36408,7 +35737,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36492,9 +35820,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -36538,7 +35864,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36567,7 +35892,6 @@ export function bootstrap( await implementation.reactionsDeleteForTeamDiscussion(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -36645,7 +35969,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36707,7 +36030,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36745,7 +36067,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36790,7 +36111,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36818,7 +36138,6 @@ export function bootstrap( await implementation.teamsRemoveMembershipForUserInOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -36903,7 +36222,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -36980,7 +36298,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -37024,7 +36341,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -37054,7 +36370,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -37254,7 +36569,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -37717,7 +37031,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -37753,7 +37066,6 @@ export function bootstrap( await implementation.teamsAddOrUpdateRepoPermissionsInOrg(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -37781,7 +37093,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -37855,7 +37166,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -37893,7 +37203,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -37952,9 +37261,7 @@ export function bootstrap( project_url: z.coerce.string(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -37963,9 +37270,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -37974,9 +37279,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -37988,7 +37291,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38057,9 +37359,7 @@ export function bootstrap( project_url: z.coerce.string(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38068,9 +37368,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38079,9 +37377,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38090,9 +37386,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -38103,7 +37397,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38134,9 +37427,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38144,9 +37435,7 @@ export function bootstrap( errors: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38158,7 +37447,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38184,9 +37472,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38195,9 +37481,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38214,9 +37498,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -38239,9 +37521,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -38260,7 +37540,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38297,9 +37576,7 @@ export function bootstrap( updated_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38308,9 +37585,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38319,9 +37594,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38333,7 +37606,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38372,9 +37644,7 @@ export function bootstrap( updated_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38383,9 +37653,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38397,7 +37665,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38430,9 +37697,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38444,7 +37709,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38516,9 +37780,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38527,9 +37789,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38541,7 +37801,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38613,9 +37872,7 @@ export function bootstrap( project_url: z.coerce.string(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38624,9 +37881,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38635,9 +37890,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .union([ z.object({ @@ -38667,9 +37920,7 @@ export function bootstrap( }), ]) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -38688,7 +37939,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38716,9 +37966,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38727,9 +37975,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38738,9 +37984,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -38751,7 +37995,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -38811,9 +38054,7 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38822,9 +38063,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38836,7 +38075,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -38907,9 +38145,7 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38918,9 +38154,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38928,9 +38162,7 @@ export function bootstrap( errors: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38939,9 +38171,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -38952,7 +38182,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -38976,9 +38205,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38986,9 +38213,7 @@ export function bootstrap( errors: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -38997,9 +38222,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39011,7 +38234,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -39074,9 +38296,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39085,9 +38305,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39096,9 +38314,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39107,9 +38323,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -39135,7 +38349,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -39176,9 +38389,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39187,9 +38398,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39198,9 +38407,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -39226,7 +38433,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -39263,9 +38469,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39274,9 +38478,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39285,9 +38487,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -39313,7 +38513,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -39368,9 +38567,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39379,9 +38576,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39390,9 +38585,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39401,9 +38594,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -39429,7 +38620,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -39473,9 +38663,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39484,9 +38672,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39498,7 +38684,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -39537,9 +38722,7 @@ export function bootstrap( updated_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39548,9 +38731,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39559,9 +38740,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -39572,7 +38751,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -39667,9 +38845,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39681,7 +38857,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -39896,9 +39071,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -39910,7 +39083,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -40114,9 +39286,7 @@ export function bootstrap( badge_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -40128,7 +39298,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -40171,9 +39340,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -40185,7 +39352,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -41291,9 +40457,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -41302,9 +40466,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -41313,9 +40475,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -41327,7 +40487,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -42478,9 +41637,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 307) { + } else if (status === 307) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -42489,9 +41646,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -42500,9 +41655,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -42511,9 +41664,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -42539,7 +41690,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -42566,18 +41716,14 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -42589,7 +41735,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -42657,7 +41802,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -42710,7 +41854,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -42737,7 +41880,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -42779,7 +41921,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -42818,7 +41959,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -42886,7 +42026,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -42946,7 +42085,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -42974,7 +42112,6 @@ export function bootstrap( await implementation.actionsDeleteActionsCacheById(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -43058,7 +42195,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43086,7 +42222,6 @@ export function bootstrap( await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -43122,9 +42257,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -43136,7 +42269,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43169,9 +42301,7 @@ export function bootstrap( include_claim_keys: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -43182,9 +42312,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -43196,7 +42324,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43232,9 +42359,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -43245,9 +42370,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -43256,9 +42379,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -43269,7 +42390,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43311,7 +42431,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43349,7 +42468,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -43389,7 +42507,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43423,7 +42540,6 @@ export function bootstrap( await implementation.actionsSetWorkflowAccessToRepository(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -43460,7 +42576,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43498,7 +42613,6 @@ export function bootstrap( await implementation.actionsSetAllowedActionsRepository(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -43535,7 +42649,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -43572,7 +42685,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -44098,7 +43210,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -44157,7 +43268,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -44199,7 +43309,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -44541,7 +43650,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -44883,7 +43991,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -44930,7 +44037,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -44958,7 +44064,6 @@ export function bootstrap( await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -45001,9 +44106,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -45015,7 +44118,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -45065,9 +44167,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -45076,9 +44176,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -45089,7 +44187,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -45139,9 +44236,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -45150,9 +44245,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -45163,7 +44256,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -45207,9 +44299,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -45221,7 +44311,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -45266,9 +44355,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -45277,9 +44364,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -45290,7 +44375,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -45815,7 +44899,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -46307,7 +45390,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -46337,7 +45419,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -46418,7 +45499,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -46449,9 +45529,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -46460,9 +45538,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -46474,7 +45550,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -46541,7 +45616,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47038,7 +46112,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47131,9 +46204,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -47145,7 +46216,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47174,7 +46244,6 @@ export function bootstrap( await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -47205,9 +46274,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -47219,7 +46286,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47315,7 +46381,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47343,7 +46408,6 @@ export function bootstrap( await implementation.actionsDownloadWorkflowRunLogs(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -47379,9 +46443,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -47393,7 +46455,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47448,7 +46509,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47582,7 +46642,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47617,7 +46676,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47656,7 +46714,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47738,7 +46795,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47787,7 +46843,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47829,7 +46884,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47866,7 +46920,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47906,7 +46959,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -47936,7 +46988,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -47989,7 +47040,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48027,7 +47077,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48068,7 +47117,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48103,7 +47151,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -48133,7 +47180,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -48202,7 +47248,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48253,7 +47298,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48283,7 +47327,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -48319,7 +47362,6 @@ export function bootstrap( await implementation.actionsCreateWorkflowDispatch(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -48346,7 +47388,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -48871,7 +47912,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48919,7 +47959,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -48977,9 +48016,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -48991,7 +48028,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -49030,7 +48066,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -49073,7 +48108,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -49113,9 +48147,7 @@ export function bootstrap( is_alphanumeric: z.coerce.boolean(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -49141,7 +48173,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -49173,9 +48204,7 @@ export function bootstrap( is_alphanumeric: z.coerce.boolean(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -49187,7 +48216,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -49225,7 +48253,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -49252,7 +48279,6 @@ export function bootstrap( await implementation.reposEnableAutomatedSecurityFixes(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -49279,7 +48305,6 @@ export function bootstrap( await implementation.reposDisableAutomatedSecurityFixes(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -49745,9 +48770,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -49759,7 +48782,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -50322,9 +49344,7 @@ export function bootstrap( required_approving_review_count: z.coerce.number().optional(), }) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -50333,9 +49353,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -50347,7 +49365,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -50786,9 +49803,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -50800,7 +49815,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -51278,9 +50292,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -51289,9 +50301,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -51300,9 +50310,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -51313,7 +50321,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -51354,7 +50361,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -51388,7 +50394,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -51422,7 +50427,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -51461,7 +50465,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -51748,7 +50751,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52058,9 +51060,7 @@ export function bootstrap( require_last_push_approval: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -52086,7 +51086,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52125,7 +51124,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52156,9 +51154,7 @@ export function bootstrap( ctx.body = z .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52170,7 +51166,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52201,9 +51196,7 @@ export function bootstrap( ctx.body = z .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52215,7 +51208,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52254,7 +51246,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52296,9 +51287,7 @@ export function bootstrap( contexts_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52310,7 +51299,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52370,9 +51358,7 @@ export function bootstrap( contexts_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52381,9 +51367,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -52409,7 +51393,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52437,7 +51420,6 @@ export function bootstrap( await implementation.reposRemoveStatusCheckProtection(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -52466,9 +51448,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.coerce.string()).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52480,7 +51460,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52519,9 +51498,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.coerce.string()).parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52530,9 +51507,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52541,9 +51516,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -52569,7 +51542,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52608,9 +51580,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.coerce.string()).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52619,9 +51589,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -52647,7 +51615,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52684,9 +51651,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.coerce.string()).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52695,9 +51660,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -52723,7 +51686,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52848,9 +51810,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52862,7 +51822,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -52890,7 +51849,6 @@ export function bootstrap( await implementation.reposDeleteAccessRestrictions(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -52969,9 +51927,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -52983,7 +51939,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53070,9 +52025,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53098,7 +52051,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53185,9 +52137,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53213,7 +52163,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53300,9 +52249,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53328,7 +52275,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53399,9 +52345,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -53413,7 +52357,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53489,9 +52432,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53517,7 +52458,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53593,9 +52533,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53621,7 +52559,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53697,9 +52634,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53725,7 +52660,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53783,9 +52717,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -53797,7 +52729,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53860,9 +52791,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53888,7 +52817,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -53951,9 +52879,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -53979,7 +52905,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -54042,9 +52967,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -54070,7 +52993,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -54638,9 +53560,7 @@ export function bootstrap( required_approving_review_count: z.coerce.number().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -54649,9 +53569,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -54660,9 +53578,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -54688,7 +53604,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -54889,7 +53804,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -55086,7 +54000,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -55344,7 +54257,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -55395,7 +54307,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -55423,9 +54334,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -55434,9 +54343,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -55445,9 +54352,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -55459,7 +54364,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -55765,9 +54669,7 @@ export function bootstrap( runs_rerequestable: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -56049,7 +54951,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -56265,7 +55166,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -56570,7 +55470,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -56787,7 +55686,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -56818,7 +55716,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -56950,9 +55847,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -56961,9 +55856,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -56972,9 +55865,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -56985,7 +55876,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57099,9 +55989,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57110,9 +55998,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57121,9 +56007,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57134,7 +56018,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57259,9 +56142,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57270,9 +56151,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57281,9 +56160,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57294,7 +56171,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57361,9 +56237,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57372,9 +56246,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57383,9 +56255,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57396,7 +56266,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57462,9 +56331,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57473,9 +56340,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57484,9 +56349,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57497,7 +56360,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57528,9 +56390,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.object({}).parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57539,9 +56399,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57550,9 +56408,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57563,7 +56419,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57606,9 +56461,7 @@ export function bootstrap( confirm_delete_url: z.coerce.string(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57619,9 +56472,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57630,9 +56481,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57641,9 +56490,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57654,7 +56501,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57718,9 +56564,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57729,9 +56573,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57740,9 +56582,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57753,7 +56593,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57816,9 +56655,7 @@ export function bootstrap( url: z.coerce.string(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57827,9 +56664,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57838,9 +56673,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57851,7 +56684,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57896,9 +56728,7 @@ export function bootstrap( url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57907,9 +56737,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57918,9 +56746,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57931,7 +56757,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -57967,9 +56792,7 @@ export function bootstrap( errors: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -57978,9 +56801,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -57991,7 +56812,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -58039,7 +56859,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -58373,9 +57192,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -58384,9 +57201,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -58395,9 +57210,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -58406,9 +57219,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -58420,7 +57231,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -58753,9 +57563,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z .object({ id: z.coerce.number(), @@ -59043,9 +57851,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59056,9 +57862,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59067,9 +57871,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59078,9 +57880,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59089,9 +57889,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -59102,7 +57900,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59150,9 +57947,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59163,9 +57958,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59174,9 +57967,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59185,9 +57976,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59196,9 +57985,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59210,7 +57997,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59264,9 +58050,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59275,9 +58059,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59286,9 +58068,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59297,9 +58077,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59311,7 +58089,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59384,9 +58161,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59395,9 +58170,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59406,9 +58179,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59420,7 +58191,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59472,7 +58242,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59514,7 +58283,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59554,7 +58322,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59594,7 +58361,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59624,7 +58390,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -59698,9 +58463,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -59712,7 +58475,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -59742,7 +58504,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -59998,9 +58759,7 @@ export function bootstrap( node_id: z.coerce.string(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60009,9 +58768,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -60037,7 +58794,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60067,7 +58823,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -60133,9 +58888,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60147,7 +58900,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60249,7 +59001,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60338,9 +59089,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60352,7 +59101,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60448,9 +59196,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60462,7 +59208,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60503,7 +59248,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60593,9 +59337,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60607,7 +59349,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60691,9 +59432,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -60734,9 +59473,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -60762,7 +59499,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -60791,7 +59527,6 @@ export function bootstrap( await implementation.reactionsDeleteForCommitComment(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -60947,9 +59682,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60960,9 +59693,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60971,9 +59702,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60982,9 +59711,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -60996,7 +59723,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -61036,9 +59762,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -61064,7 +59788,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -61169,7 +59892,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -61268,9 +59990,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -61279,9 +59999,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -61307,7 +60025,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -62272,7 +60989,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -62422,9 +61138,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -62433,9 +61147,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -62458,9 +61170,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -62469,9 +61179,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -62482,7 +61190,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -62697,7 +61404,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -63020,7 +61726,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -63242,9 +61947,7 @@ export function bootstrap( url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -63256,7 +61959,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -63331,9 +62033,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -63345,7 +62045,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -63420,7 +62119,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -63849,9 +62547,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -63860,9 +62556,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -63871,9 +62565,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -63884,7 +62576,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -63989,9 +62680,7 @@ export function bootstrap( }), ]) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64000,9 +62689,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64014,7 +62701,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -64132,9 +62818,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ content: z.object({ @@ -64201,9 +62885,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64212,9 +62894,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64223,9 +62903,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -64251,7 +62929,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -64359,9 +63036,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64370,9 +63045,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64381,9 +63054,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -64406,9 +63077,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -64419,7 +63088,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -64478,9 +63146,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64489,9 +63155,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64503,7 +63167,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -64658,9 +63321,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64671,9 +63332,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64682,9 +63341,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64693,9 +63350,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -64706,7 +63361,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -64834,9 +63488,7 @@ export function bootstrap( fixed_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64845,9 +63497,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -64859,7 +63509,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65001,9 +63650,7 @@ export function bootstrap( fixed_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65014,9 +63661,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65025,9 +63670,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65036,9 +63679,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65047,9 +63688,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -65060,7 +63699,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65112,7 +63750,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65147,7 +63784,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65187,7 +63823,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65227,7 +63862,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65257,7 +63891,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -65317,9 +63950,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65328,9 +63959,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65342,7 +63971,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65402,7 +64030,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65534,7 +64161,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65664,15 +64290,11 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z .object({ message: z.coerce.string().optional() }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -65698,7 +64320,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65817,9 +64438,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -65831,7 +64450,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -65866,9 +64484,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -65879,7 +64495,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66016,9 +64631,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -66030,7 +64643,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66178,9 +64790,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -66206,7 +64816,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66334,9 +64943,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -66348,7 +64955,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66407,7 +65013,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66469,7 +65074,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66517,7 +65121,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66586,9 +65189,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -66600,7 +65201,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66630,7 +65230,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -66681,7 +65280,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66726,7 +65324,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66765,7 +65362,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66811,7 +65407,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -66840,7 +65435,6 @@ export function bootstrap( await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -67622,7 +66216,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -67817,9 +66410,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -67833,7 +66424,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -68964,9 +67554,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -68977,9 +67565,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -68988,9 +67574,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -68999,9 +67583,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69027,7 +67609,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69058,9 +67639,7 @@ export function bootstrap( ctx.body = z .object({ url: z.coerce.string(), sha: z.coerce.string() }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69069,9 +67648,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69080,9 +67657,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69091,9 +67666,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69119,7 +67692,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69154,9 +67726,7 @@ export function bootstrap( highlighted_content: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69165,9 +67735,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69176,9 +67744,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69204,7 +67770,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69281,9 +67846,7 @@ export function bootstrap( html_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69292,9 +67855,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69320,7 +67881,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69377,9 +67937,7 @@ export function bootstrap( html_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69391,7 +67949,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69435,7 +67992,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69471,9 +68027,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69485,7 +68039,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69526,9 +68079,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69554,7 +68105,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69595,9 +68145,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69623,7 +68171,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69672,7 +68219,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69736,9 +68282,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69764,7 +68308,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69815,9 +68358,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69829,7 +68370,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69884,9 +68424,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69895,9 +68433,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69906,9 +68442,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -69934,7 +68468,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -69979,9 +68512,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -69990,9 +68521,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -70018,7 +68547,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70083,9 +68611,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70097,7 +68623,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70173,9 +68698,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70184,9 +68707,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70195,9 +68716,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -70223,7 +68742,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70279,9 +68797,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70293,7 +68809,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70369,9 +68884,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70380,9 +68893,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -70408,7 +68919,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70446,7 +68956,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70485,7 +68994,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70536,7 +69044,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70592,9 +69099,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70605,9 +69110,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -70633,7 +69136,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70685,9 +69187,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70698,9 +69198,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -70726,7 +69224,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70756,9 +69253,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70769,9 +69264,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -70797,7 +69290,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70832,7 +69324,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70870,7 +69361,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -70951,9 +69441,7 @@ export function bootstrap( svn_root: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70962,9 +69450,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -70976,7 +69462,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71062,9 +69547,7 @@ export function bootstrap( svn_root: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71073,9 +69556,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -71098,9 +69579,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71112,7 +69591,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71202,9 +69680,7 @@ export function bootstrap( svn_root: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71216,7 +69692,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71256,7 +69731,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71305,9 +69779,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71316,9 +69788,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71330,7 +69800,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71378,9 +69847,7 @@ export function bootstrap( import_url: z.coerce.string(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71389,9 +69856,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -71414,9 +69879,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71428,7 +69891,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71467,9 +69929,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71481,7 +69941,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71566,9 +70025,7 @@ export function bootstrap( svn_root: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -71591,9 +70048,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71605,7 +70060,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71724,9 +70178,7 @@ export function bootstrap( contact_email: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71735,9 +70187,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -71749,7 +70199,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71780,7 +70229,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71835,7 +70283,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -71862,7 +70309,6 @@ export function bootstrap( await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -72123,7 +70569,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -72386,7 +70831,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -72413,7 +70857,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -73022,9 +71465,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -73033,9 +71474,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -73044,9 +71483,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -73072,7 +71509,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -73683,9 +72119,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -73694,9 +72128,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -73705,9 +72137,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -73716,9 +72146,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -73741,9 +72169,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -73754,7 +72180,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -73906,9 +72331,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -73917,9 +72340,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -73945,7 +72366,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -74079,9 +72499,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -74093,7 +72511,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -74232,9 +72649,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -74260,7 +72675,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -74287,7 +72701,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -74377,9 +72790,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -74391,7 +72802,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -74475,9 +72885,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -74518,9 +72926,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -74546,7 +72952,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -74575,7 +72980,6 @@ export function bootstrap( await implementation.reactionsDeleteForIssueComment(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -75441,9 +73845,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -75469,7 +73871,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -76321,9 +74722,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -76332,9 +74731,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -76343,9 +74740,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -76357,7 +74752,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -76948,9 +75342,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -76959,9 +75351,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -76970,9 +75360,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -76984,7 +75372,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -77600,9 +75987,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -77611,9 +75996,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -77622,9 +76005,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -77633,9 +76014,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -77644,9 +76023,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -77669,9 +76046,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -77682,7 +76057,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -78283,7 +76657,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -78884,7 +77257,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -78924,7 +77296,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79069,9 +77440,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79080,9 +77449,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79094,7 +77461,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79233,9 +77599,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79244,9 +77608,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79255,9 +77617,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79266,9 +77626,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -79294,7 +77652,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79324,9 +77681,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.object({})).parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79338,7 +77693,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79386,9 +77740,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79397,9 +77749,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79408,9 +77758,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79422,7 +77770,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79469,9 +77816,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79480,9 +77825,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79491,9 +77834,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79502,9 +77843,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -79530,7 +77869,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79577,9 +77915,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79588,9 +77924,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79599,9 +77933,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79610,9 +77942,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -79638,7 +77968,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79673,9 +78002,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79684,9 +78011,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79698,7 +78023,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79739,9 +78063,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 301) { + } else if (status === 301) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79750,9 +78072,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79761,9 +78081,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79775,7 +78093,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79815,9 +78132,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79826,9 +78141,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79837,9 +78150,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -79865,7 +78176,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79897,9 +78207,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -79911,7 +78219,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -79997,9 +78304,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80008,9 +78313,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80022,7 +78325,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80105,9 +78407,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -80148,9 +78448,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -80176,7 +78474,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80207,7 +78504,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -80246,9 +78542,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.object({})).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80257,9 +78551,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80271,7 +78563,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80320,7 +78611,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80365,9 +78655,7 @@ export function bootstrap( last_used: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -80393,7 +78681,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80433,9 +78720,7 @@ export function bootstrap( last_used: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80447,7 +78732,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80474,7 +78758,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -80521,9 +78804,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80535,7 +78816,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80578,9 +78858,7 @@ export function bootstrap( default: z.coerce.boolean(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80589,9 +78867,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -80617,7 +78893,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80652,9 +78927,7 @@ export function bootstrap( default: z.coerce.boolean(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -80666,7 +78939,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80715,7 +78987,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80742,7 +79013,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -80772,7 +79042,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80802,7 +79071,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80831,7 +79099,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -80888,7 +79155,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -80926,7 +79192,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81070,9 +79335,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -81081,9 +79344,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -81109,7 +79370,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -81186,9 +79446,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -81200,7 +79458,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81275,9 +79532,7 @@ export function bootstrap( due_on: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -81286,9 +79541,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -81314,7 +79567,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81383,9 +79635,7 @@ export function bootstrap( due_on: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -81397,7 +79647,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81478,7 +79727,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81516,7 +79764,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81568,7 +79815,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81795,7 +80041,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81840,7 +80085,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81906,9 +80150,7 @@ export function bootstrap( https_enforced: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -81920,7 +80162,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -81999,9 +80240,7 @@ export function bootstrap( https_enforced: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82010,9 +80249,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -82038,7 +80275,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82085,9 +80321,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82096,9 +80330,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -82124,7 +80356,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82158,9 +80389,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82169,9 +80398,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -82197,7 +80424,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82267,7 +80493,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82302,7 +80527,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82368,7 +80592,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82432,7 +80655,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82475,9 +80697,7 @@ export function bootstrap( preview_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82488,9 +80708,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82499,9 +80717,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -82527,7 +80743,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82628,13 +80843,9 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82646,7 +80857,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82723,9 +80933,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82734,9 +80942,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82745,9 +80951,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82756,9 +80960,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82767,9 +80969,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -82780,7 +80980,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -82854,9 +81053,7 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82865,9 +81062,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82876,9 +81071,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82887,9 +81080,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 410) { + } else if (status === 410) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -82898,9 +81089,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -82911,7 +81100,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -83866,9 +82054,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -83894,7 +82080,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -84493,9 +82678,7 @@ export function bootstrap( changed_files: z.coerce.number(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -84504,9 +82687,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -84532,7 +82713,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -84654,7 +82834,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -84761,9 +82940,7 @@ export function bootstrap( body_text: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -84775,7 +82952,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -84892,7 +83068,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -84933,7 +83108,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -85026,9 +83200,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -85040,7 +83212,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -85127,9 +83298,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -85170,9 +83339,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -85198,7 +83365,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -85227,7 +83393,6 @@ export function bootstrap( await implementation.reactionsDeleteForPullRequestComment(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -85821,9 +83986,7 @@ export function bootstrap( changed_files: z.coerce.number(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -85832,9 +83995,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -85843,9 +84004,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -85856,7 +84015,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -86460,9 +84618,7 @@ export function bootstrap( changed_files: z.coerce.number(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -86471,9 +84627,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -86499,7 +84653,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -86832,9 +84985,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z .object({ id: z.coerce.number(), @@ -87122,9 +85273,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87133,9 +85282,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87144,9 +85291,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87155,9 +85300,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -87168,7 +85311,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -87291,7 +85433,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -87413,9 +85554,7 @@ export function bootstrap( body_text: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87424,9 +85563,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -87452,7 +85589,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -87568,9 +85704,7 @@ export function bootstrap( body_text: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87582,7 +85716,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -87737,7 +85870,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -87791,9 +85923,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -87816,9 +85946,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87827,9 +85955,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -87840,7 +85966,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -87867,7 +85992,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -87907,9 +86031,7 @@ export function bootstrap( message: z.coerce.string(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87918,9 +86040,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -87929,27 +86049,21 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 405) { + } else if (status === 405) { ctx.body = z .object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -87975,7 +86089,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -88075,7 +86188,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -89030,9 +87142,7 @@ export function bootstrap( draft: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -89044,7 +87154,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90001,9 +88110,7 @@ export function bootstrap( draft: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90029,7 +88136,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90117,7 +88223,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90219,9 +88324,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90230,9 +88333,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90243,7 +88344,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90322,9 +88422,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90336,7 +88434,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90420,9 +88517,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90433,7 +88528,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90518,9 +88612,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90529,9 +88621,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90542,7 +88632,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90663,9 +88752,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90677,7 +88764,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90764,9 +88850,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90775,9 +88859,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90788,7 +88870,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90875,9 +88956,7 @@ export function bootstrap( ]), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90886,9 +88965,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90897,9 +88974,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90910,7 +88985,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -90947,9 +89021,7 @@ export function bootstrap( url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -90958,9 +89030,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -90986,7 +89056,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91035,9 +89104,7 @@ export function bootstrap( submodule_git_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -91046,9 +89113,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -91074,7 +89139,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91133,9 +89197,7 @@ export function bootstrap( submodule_git_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -91144,9 +89206,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -91172,7 +89232,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91305,9 +89364,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -91319,7 +89376,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91457,9 +89513,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -91468,9 +89522,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -91496,7 +89548,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91562,9 +89613,7 @@ export function bootstrap( }), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -91576,7 +89625,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91656,7 +89704,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91686,7 +89733,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -91725,9 +89771,7 @@ export function bootstrap( ctx.body = z .object({ name: z.coerce.string(), body: z.coerce.string() }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -91739,7 +89783,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91868,7 +89911,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -91995,9 +90037,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -92009,7 +90049,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92133,9 +90172,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -92147,7 +90184,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92287,9 +90323,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -92301,7 +90335,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92328,7 +90361,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -92407,7 +90439,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92486,7 +90517,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92566,9 +90596,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -92580,7 +90608,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92654,9 +90681,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -92697,9 +90722,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -92725,7 +90748,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -92756,7 +90778,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -92889,9 +90910,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -92902,7 +90921,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93015,9 +91033,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -93028,7 +91044,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93149,9 +91164,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -93162,7 +91175,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93226,9 +91238,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -93239,7 +91249,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93275,9 +91284,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.object({}).parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -93303,7 +91310,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93333,14 +91339,11 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.array(z.coerce.number())).parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z.object({}).parse(body) } ctx.status = status - ctx.body = body return next() } ) @@ -93378,14 +91381,11 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z.object({}).parse(body) } ctx.status = status - ctx.body = body return next() } ) @@ -93452,14 +91452,11 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z.object({}).parse(body) } ctx.status = status - ctx.body = body return next() } ) @@ -93494,9 +91491,7 @@ export function bootstrap( owner: z.array(z.coerce.number()), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -93508,7 +91503,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93541,7 +91535,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93618,7 +91611,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93685,7 +91677,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93724,9 +91715,7 @@ export function bootstrap( repository_url: z.coerce.string(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -93738,7 +91727,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93790,7 +91778,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93817,7 +91804,6 @@ export function bootstrap( await implementation.activityDeleteRepoSubscription(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -93859,7 +91845,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -93898,9 +91883,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -93909,9 +91892,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -93923,7 +91904,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -93965,9 +91945,7 @@ export function bootstrap( pattern: z.coerce.string(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -93976,9 +91954,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -93990,7 +91966,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94028,9 +92003,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94042,7 +92015,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94072,7 +92044,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -94143,7 +92114,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94175,9 +92145,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.object({ names: z.array(z.coerce.string()) }).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94189,7 +92157,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94220,9 +92187,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.object({ names: z.array(z.coerce.string()) }).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94231,9 +92196,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -94244,7 +92207,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94284,9 +92246,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94298,7 +92258,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94331,9 +92290,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94345,7 +92302,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94380,9 +92336,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94394,7 +92348,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94434,9 +92387,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -94448,7 +92399,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94635,7 +92585,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -94662,7 +92611,6 @@ export function bootstrap( await implementation.reposCheckVulnerabilityAlerts(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -94689,7 +92637,6 @@ export function bootstrap( await implementation.reposEnableVulnerabilityAlerts(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -94716,7 +92663,6 @@ export function bootstrap( await implementation.reposDisableVulnerabilityAlerts(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -94746,7 +92692,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -95085,7 +93030,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95261,9 +93205,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -95289,7 +93231,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -95338,7 +93279,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95378,7 +93318,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95418,7 +93357,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95458,7 +93396,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95486,7 +93423,6 @@ export function bootstrap( await implementation.actionsDeleteEnvironmentSecret(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -95537,7 +93473,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95576,7 +93511,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95615,7 +93549,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -95651,7 +93584,6 @@ export function bootstrap( await implementation.actionsUpdateEnvironmentVariable(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -95679,7 +93611,6 @@ export function bootstrap( await implementation.actionsDeleteEnvironmentVariable(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -95906,9 +93837,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -95917,9 +93846,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -95942,9 +93869,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -95955,7 +93880,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -96238,7 +94162,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -96847,9 +94770,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -96858,9 +94779,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -96883,9 +94802,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -96896,7 +94813,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -96956,9 +94872,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -96967,9 +94881,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -96978,9 +94890,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -97006,7 +94916,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -97183,9 +95092,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -97208,9 +95115,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -97221,7 +95126,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -97313,7 +95217,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -97405,9 +95308,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -97430,9 +95331,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -97443,7 +95342,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -97563,9 +95461,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -97577,7 +95473,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -97705,9 +95600,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 201) { + } else if (status === 201) { ctx.body = z .object({ id: z.coerce.number(), @@ -97812,9 +95705,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -97823,9 +95714,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -97834,9 +95723,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -97862,7 +95749,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -97886,9 +95772,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -97914,7 +95798,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -98012,7 +95895,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98109,7 +95991,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98198,7 +96079,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98297,7 +96177,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98326,7 +96205,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -98419,7 +96297,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98508,7 +96385,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98591,7 +96467,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98681,7 +96556,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98709,7 +96583,6 @@ export function bootstrap( await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -98805,7 +96678,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98895,7 +96767,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -98987,7 +96858,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99073,7 +96943,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99150,7 +97019,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99211,9 +97079,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -99225,7 +97091,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99251,7 +97116,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -99288,7 +97152,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99317,7 +97180,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -99351,9 +97213,7 @@ export function bootstrap( state: z.enum(["active", "pending"]), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -99365,7 +97225,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99406,9 +97265,7 @@ export function bootstrap( state: z.enum(["active", "pending"]), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -99420,7 +97277,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99447,7 +97303,6 @@ export function bootstrap( await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) ctx.status = status - ctx.body = body return next() } ) @@ -99528,9 +97383,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -99542,7 +97395,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99618,7 +97470,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99661,9 +97512,7 @@ export function bootstrap( documentation_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -99672,9 +97521,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -99700,7 +97547,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99737,9 +97583,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -99765,7 +97609,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -99961,9 +97804,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -99975,7 +97816,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -100437,7 +98277,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -100480,9 +98319,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -100508,7 +98345,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -100535,7 +98371,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -100605,9 +98440,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100616,9 +98449,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100627,9 +98458,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -100655,7 +98484,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -100782,9 +98610,7 @@ export function bootstrap( }), ]) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100793,9 +98619,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100807,7 +98631,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -100890,9 +98713,7 @@ export function bootstrap( ldap_dn: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100901,9 +98722,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100912,9 +98731,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -100923,9 +98740,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -100951,7 +98766,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -101004,9 +98818,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101015,9 +98827,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101026,9 +98836,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101040,7 +98848,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -101071,9 +98878,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101082,9 +98887,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101096,7 +98899,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -101121,9 +98923,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101132,9 +98932,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101143,9 +98941,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -101171,7 +98967,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -101195,9 +98990,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101206,9 +98999,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101220,7 +99011,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -101543,9 +99333,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101554,9 +99342,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101565,9 +99351,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101576,9 +99360,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -101590,7 +99372,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -101926,9 +99707,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 202) { + } else if (status === 202) { ctx.body = z .object({ id: z.coerce.number(), @@ -102216,9 +99995,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102227,9 +100004,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102238,9 +100013,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102249,9 +100022,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 503) { + } else if (status === 503) { ctx.body = z .object({ code: z.coerce.string().optional(), @@ -102262,7 +100033,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102309,7 +100079,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102337,7 +100106,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102375,7 +100143,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102415,9 +100182,7 @@ export function bootstrap( if (status === 201) { ctx.body = z.object({}).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102426,9 +100191,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -102454,7 +100217,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102483,7 +100245,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -102680,9 +100441,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102691,9 +100450,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102702,9 +100459,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102713,9 +100468,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102727,7 +100480,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102769,9 +100521,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102780,9 +100530,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102791,9 +100539,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102805,7 +100551,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102844,9 +100589,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102855,9 +100598,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102866,9 +100607,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102880,7 +100619,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -102919,9 +100657,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102930,9 +100666,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102941,9 +100675,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -102955,7 +100687,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -103268,9 +100999,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103279,9 +101008,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103290,9 +101017,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103301,9 +101026,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103315,7 +101038,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -103639,9 +101361,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103650,9 +101370,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103661,9 +101379,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103675,7 +101391,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -103702,9 +101417,7 @@ export function bootstrap( if (status === 202) { ctx.body = z.object({}).parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103713,9 +101426,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103724,9 +101435,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103735,9 +101444,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103749,7 +101456,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -103789,9 +101495,7 @@ export function bootstrap( html_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103800,9 +101504,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103811,9 +101513,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103822,9 +101522,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -103847,9 +101545,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103861,7 +101557,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -103905,9 +101600,7 @@ export function bootstrap( html_url: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103919,7 +101612,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -103964,9 +101656,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103975,9 +101665,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103986,9 +101674,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -103997,9 +101683,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -104011,7 +101695,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -105267,9 +102950,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105278,9 +102959,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105289,9 +102968,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105300,9 +102977,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -105328,7 +103003,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -105641,9 +103315,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105654,9 +103326,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105665,9 +103335,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 402) { + } else if (status === 402) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105676,9 +103344,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105687,9 +103353,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105698,9 +103362,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105709,9 +103371,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -105723,7 +103383,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106036,9 +103695,7 @@ export function bootstrap( last_known_stop_notice: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106047,9 +103704,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106058,9 +103713,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106069,9 +103722,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 500) { + } else if (status === 500) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106083,7 +103734,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106122,9 +103772,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106133,9 +103781,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106144,9 +103790,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106155,9 +103799,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -106183,7 +103825,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106220,9 +103861,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106231,9 +103870,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106242,9 +103879,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106256,7 +103891,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106294,9 +103928,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106305,9 +103937,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106316,9 +103946,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106327,9 +103955,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -106355,7 +103981,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106391,9 +104016,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106402,9 +104025,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106413,9 +104034,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -106441,7 +104060,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106495,9 +104113,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106506,9 +104122,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106520,7 +104134,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106574,9 +104187,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106585,9 +104196,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106599,7 +104208,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106636,9 +104244,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106647,9 +104253,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106661,7 +104265,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106686,9 +104289,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106697,9 +104298,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106711,7 +104310,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -106738,9 +104336,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106749,9 +104345,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106763,7 +104357,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106833,9 +104426,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106844,9 +104435,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106855,9 +104444,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106869,7 +104456,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -106937,9 +104523,7 @@ export function bootstrap( raw_key: z.coerce.string(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106948,9 +104532,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106959,9 +104541,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -106970,9 +104550,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -106998,7 +104576,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107065,9 +104642,7 @@ export function bootstrap( raw_key: z.coerce.string(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107076,9 +104651,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107087,9 +104660,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107101,7 +104672,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107135,9 +104705,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107146,9 +104714,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107157,9 +104723,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -107185,7 +104749,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107316,9 +104879,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107327,9 +104888,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107341,7 +104900,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107685,9 +105243,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107696,9 +105252,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107710,7 +105264,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107748,9 +105301,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107762,7 +105313,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107801,9 +105351,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -107815,7 +105363,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107841,7 +105388,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107888,9 +105434,7 @@ export function bootstrap( expires_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -107916,7 +105460,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -107938,7 +105481,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -108542,9 +106084,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108556,7 +106096,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -108599,9 +106138,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108610,9 +106147,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108621,9 +106156,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108635,7 +106168,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -108676,9 +106208,7 @@ export function bootstrap( read_only: z.coerce.boolean(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108687,9 +106217,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108698,9 +106226,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108709,9 +106235,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -108737,7 +106261,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -108777,9 +106300,7 @@ export function bootstrap( read_only: z.coerce.boolean(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108788,9 +106309,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108799,9 +106318,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108813,7 +106330,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -108850,9 +106366,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108861,9 +106375,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108875,7 +106387,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -108944,9 +106455,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108955,9 +106464,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -108969,7 +106476,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -109038,9 +106544,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109052,7 +106556,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -109130,9 +106633,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109141,9 +106642,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109152,9 +106651,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -109180,7 +106677,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -109254,9 +106750,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109265,9 +106759,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109279,7 +106771,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -109363,9 +106854,7 @@ export function bootstrap( .optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109374,9 +106863,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109385,9 +106872,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -109413,7 +106898,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -109786,9 +107270,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109797,9 +107279,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -109811,7 +107291,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -110189,9 +107668,7 @@ export function bootstrap( exclude: z.array(z.object({})).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110200,9 +107677,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110211,9 +107686,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -110239,7 +107712,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -110616,9 +108088,7 @@ export function bootstrap( exclude: z.array(z.object({})).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110627,9 +108097,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110638,9 +108106,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110652,7 +108118,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -110689,9 +108154,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110703,7 +108166,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -110740,9 +108202,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110751,9 +108211,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110765,7 +108223,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -110803,9 +108260,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110814,9 +108269,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -110828,7 +108281,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111028,9 +108480,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111042,7 +108492,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111087,9 +108536,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111098,9 +108545,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111112,7 +108557,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111363,7 +108807,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111609,7 +109052,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111654,9 +109096,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111665,9 +109105,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111679,7 +109117,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111731,9 +109168,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111742,9 +109177,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111756,7 +109189,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111841,9 +109273,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111852,9 +109282,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111863,9 +109291,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -111877,7 +109303,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111950,7 +109375,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -111996,9 +109420,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112007,9 +109429,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112021,7 +109441,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -112069,9 +109488,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112080,9 +109497,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112094,7 +109509,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -112164,9 +109578,7 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112175,9 +109587,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112186,9 +109596,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -112199,7 +109607,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -112239,9 +109646,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112250,9 +109655,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112261,9 +109664,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112275,7 +109676,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -112610,9 +110010,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112621,9 +110019,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -112632,9 +110028,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -112660,7 +110054,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113011,9 +110404,7 @@ export function bootstrap( anonymous_access_enabled: z.coerce.boolean().optional(), }) .parse(body) - } - - if (status === 400) { + } else if (status === 400) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113024,9 +110415,7 @@ export function bootstrap( schemas: z.array(z.coerce.string()).optional(), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113035,9 +110424,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113046,9 +110433,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113057,9 +110442,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -113085,7 +110468,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113342,9 +110724,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113353,9 +110733,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113364,9 +110742,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113378,7 +110754,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113415,9 +110790,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113426,9 +110799,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113440,7 +110811,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113477,9 +110847,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113488,9 +110856,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 409) { + } else if (status === 409) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113502,7 +110868,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113542,9 +110907,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113553,9 +110916,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113564,9 +110925,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113578,7 +110937,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113616,9 +110974,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113627,9 +110983,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113638,9 +110992,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113649,9 +111001,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -113677,7 +111027,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113714,9 +111063,7 @@ export function bootstrap( created_at: z.coerce.string().datetime({ offset: true }), }) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113725,9 +111072,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113736,9 +111081,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113750,7 +111093,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -113787,9 +111129,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113798,9 +111138,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -113812,7 +111150,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114150,9 +111487,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114161,9 +111496,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114175,7 +111508,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114213,9 +111545,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114224,9 +111554,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114238,7 +111566,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114273,9 +111600,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114284,9 +111609,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114298,7 +111621,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114333,9 +111655,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114344,9 +111664,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114358,7 +111676,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114554,9 +111871,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114565,9 +111880,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114579,7 +111892,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114712,9 +112024,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114723,9 +112033,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114737,7 +112045,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -114787,7 +112094,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -114914,9 +112220,7 @@ export function bootstrap( }), ]) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -114928,7 +112232,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -115709,7 +113012,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -116495,7 +113797,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117277,7 +114578,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117343,7 +114643,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117409,7 +114708,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117438,7 +114736,6 @@ export function bootstrap( ) ctx.status = status - ctx.body = body return next() } ) @@ -117536,9 +114833,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -117564,7 +114859,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117643,7 +114937,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117688,9 +114981,7 @@ export function bootstrap( ), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -117699,9 +114990,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -117727,7 +115016,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117848,7 +115136,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117890,7 +115177,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -117933,7 +115219,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -118186,9 +115471,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118197,9 +115480,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118211,7 +115492,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118460,7 +115740,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118503,9 +115782,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118514,9 +115791,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118528,7 +115803,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118578,9 +115852,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118589,9 +115861,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118603,7 +115873,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118679,9 +115948,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 401) { + } else if (status === 401) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118690,9 +115957,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118701,9 +115966,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118715,7 +115978,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118786,7 +116048,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118830,9 +116091,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118841,9 +116100,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118855,7 +116112,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -118899,9 +116155,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 403) { + } else if (status === 403) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118910,9 +116164,7 @@ export function bootstrap( status: z.coerce.string().optional(), }) .parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -118924,7 +116176,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -119000,9 +116251,7 @@ export function bootstrap( }) ) .parse(body) - } - - if (status === 422) { + } else if (status === 422) { ctx.body = z .object({ message: z.coerce.string(), @@ -119028,7 +116277,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -119810,7 +117058,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -120592,7 +117839,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -120789,7 +118035,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -120842,7 +118087,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -120878,7 +118122,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -120914,7 +118157,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -120961,7 +118203,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -121001,7 +118242,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -121204,7 +118444,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() } ) @@ -121220,9 +118459,7 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.coerce.string()).parse(body) - } - - if (status === 404) { + } else if (status === 404) { ctx.body = z .object({ message: z.coerce.string().optional(), @@ -121234,7 +118471,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -121252,7 +118488,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts index dbebba113..5a6f786de 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts @@ -70,14 +70,13 @@ export function bootstrap( if (status === 200) { ctx.body = z.array(z.object({})).parse(body) + } else { + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) } - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - ctx.status = status - ctx.body = body return next() }) @@ -97,14 +96,13 @@ export function bootstrap( if (status === 200) { ctx.body = z.object({}).parse(body) + } else { + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) } - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - ctx.status = status - ctx.body = body return next() }) @@ -121,14 +119,13 @@ export function bootstrap( if (status === 200) { ctx.body = z.object({}).parse(body) + } else { + ctx.body = z + .object({ code: z.coerce.number(), message: z.coerce.string() }) + .parse(body) } - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - ctx.status = status - ctx.body = body return next() }) @@ -148,7 +145,6 @@ export function bootstrap( .parse(body) ctx.status = status - ctx.body = body return next() }) diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts index 8c413857c..c3677a082 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts @@ -89,7 +89,6 @@ export function bootstrap( } ctx.status = status - ctx.body = body return next() }) @@ -115,17 +114,16 @@ export function bootstrap( updated: z.coerce.string().datetime({ offset: true }), }) .parse(body) + } else { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }) + .parse(body) } - ctx.body = z - .object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }) - .parse(body) - ctx.status = status - ctx.body = body return next() }) @@ -153,17 +151,16 @@ export function bootstrap( updated: z.coerce.string().datetime({ offset: true }), }) .parse(body) + } else { + ctx.body = z + .object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }) + .parse(body) } - ctx.body = z - .object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }) - .parse(body) - ctx.status = status - ctx.body = body return next() }) @@ -186,7 +183,6 @@ export function bootstrap( .parse(body) ctx.status = status - ctx.body = body return next() }) diff --git a/packages/openapi-code-generator/src/typescript/common/typescript-common.ts b/packages/openapi-code-generator/src/typescript/common/typescript-common.ts index 768540753..596cea996 100644 --- a/packages/openapi-code-generator/src/typescript/common/typescript-common.ts +++ b/packages/openapi-code-generator/src/typescript/common/typescript-common.ts @@ -79,7 +79,7 @@ export function asyncMethod({ name, parameters, returnType, overloads = [], body } export function requestBodyAsParameter(operation: IROperation): { requestBodyParameter?: IRParameter, requestBodyContentType?: string } { - const { requestBody } = operation + const {requestBody} = operation if (!requestBody) { return {} @@ -105,6 +105,26 @@ export function requestBodyAsParameter(operation: IROperation): { requestBodyPar return {} } +export function ifElseIfBuilder(parts: ({ condition?: string, body: string } | undefined)[]) { + const result = [] + + const definedParts = parts.filter(isDefined).sort((a,b) => a.condition && !b.condition ? -1 : 1) + + for (const {condition, body} of definedParts) { + if (result.length === 0 && condition) { + result.push(`if(${ condition }) { ${ body } }`) + } else if (condition) { + result.push(`else if(${ condition }) { ${ body } }`) + } else if(result.length > 0) { + result.push(`else { ${ body } }`) + } else { + result.push(body) + } + } + + return result.join("\n") +} + // TODO do we need to quote names sometimes here? function params(parameters: (MethodParameterDefinition | undefined)[], quoteNames = false): string { return parameters diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index aa5e8a2d1..cbc9495cf 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -7,6 +7,7 @@ import { ModelBuilder } from "../common/model-builder" import { isDefined, titleCase } from "../../core/utils" import {SchemaBuilder, schemaBuilderFactory} from "./schema-builders/schema-builder" import {requestBodyAsParameter} from "../common/typescript-common" +import { ifElseIfBuilder } from "../common/typescript-common" function reduceParamsToOpenApiSchema(parameters: IRParameter[]): IRModelObject { return parameters.reduce((acc, parameter) => { @@ -119,29 +120,29 @@ export class ServerBuilder { const {status, body} = await implementation.${operation.operationId}(input, ctx) ${ - Object.entries(operation.responses ?? []).map(([status, response]) => { + ifElseIfBuilder(Object.entries(operation.responses ?? []).map(([status, response]) => { const content = Object.values(response.content ?? {}).pop() if (/^\d+$/.test(status) && content) { - return ` - if(status === ${ status }) { - ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body) + return { + condition: `status === ${ status }`, + body: `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)`, } - ` } else if (/^\dxx$/.test(status) && content) { - return ` - if(status >= ${ status[0] }00 && status < ${ status[0] + 1 }00){ - ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body) + return { + condition: `status >= ${ status[0] }00 && status < ${ status[0] + 1 }00`, + body: `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)`, } - ` } else if (content) { - return `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)` + return { + condition: undefined, + body: `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)`, + } } - }).join("\n") + })) } ctx.status = status - ctx.body = body return next(); })`, ].filter(isDefined).join("\n")) From 35b62c8334b0d53c62dfb490fe0a73c39b00ce72 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sat, 18 Feb 2023 13:27:53 +0000 Subject: [PATCH 03/10] wip --- .../src/typescript/common/output-utils.ts | 15 ++++++++++----- .../schema-builders/zod-schema-builder.ts | 2 +- packages/typescript-koa-runtime/src/zod.ts | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/packages/openapi-code-generator/src/typescript/common/output-utils.ts b/packages/openapi-code-generator/src/typescript/common/output-utils.ts index 0c1f621c2..27f865bff 100644 --- a/packages/openapi-code-generator/src/typescript/common/output-utils.ts +++ b/packages/openapi-code-generator/src/typescript/common/output-utils.ts @@ -44,11 +44,16 @@ export async function emitGenerationResult(dest: string, units: CompilationUnit[ } async function formatOutput(raw: string): Promise { - return prettier.format(raw, { - semi: false, - arrowParens: "always", - parser: "typescript", - }) + // try { + return prettier.format(raw, { + semi: false, + arrowParens: "always", + parser: "typescript", + }) + // } catch (err){ + // logger.error("failed to prettier", {err}) + // return raw + // } } async function writeOutput(folder: string, filename: string, data: string) { diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts index 3fb5cf617..b005a0296 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts @@ -19,7 +19,7 @@ export class ZodBuilder extends AbstractSchemaBuilder { .add(this.zod) importBuilder.from("@nahkies/typescript-koa-runtime/zod") - .add("parseRequestInput", "Params") + .add("parseRequestInput", "Params", "responseValidationFactory") } diff --git a/packages/typescript-koa-runtime/src/zod.ts b/packages/typescript-koa-runtime/src/zod.ts index c134451e4..bf93f80ca 100644 --- a/packages/typescript-koa-runtime/src/zod.ts +++ b/packages/typescript-koa-runtime/src/zod.ts @@ -16,3 +16,19 @@ export function parseRequestInput( ): z.infer | undefined { return schema?.parse(input) } + +export function responseValidationFactory(possibleResponses: [string, z.ZodTypeAny][]) { + return (status: number, value: any) => { + + for(const [match, schema] of possibleResponses) { + + const isMatch = match === "default" + || /^\\d+$/.test(match) && String(status) === match + || /^\\dxx$/.test(match) && String(status)[0] === match[0] + + if(isMatch) { + return schema.parse(value) + } + } + } +} From a3a3a6449a3f57ce5a08acbdc566d7c43082e4e3 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 12:50:17 +0100 Subject: [PATCH 04/10] chore: regenerate after rebase --- .../typescript-koa/src/api.github.com.yaml/generated.ts | 6 +++++- .../typescript-koa/src/petstore-expanded.yml/generated.ts | 6 +++++- .../typescript-koa/src/todo-lists.yml/generated.ts | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts index 4638a3203..1b56175de 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts @@ -1263,7 +1263,11 @@ import { ServerConfig, startServer, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { + Params, + parseRequestInput, + responseValidationFactory, +} from "@nahkies/typescript-koa-runtime/zod" import { Context } from "koa" import { z } from "zod" diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts index 5a6f786de..39f584806 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts @@ -13,7 +13,11 @@ import { ServerConfig, startServer, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { + Params, + parseRequestInput, + responseValidationFactory, +} from "@nahkies/typescript-koa-runtime/zod" import { Context } from "koa" import { z } from "zod" diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts index c3677a082..796165771 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts @@ -14,7 +14,11 @@ import { ServerConfig, startServer, } from "@nahkies/typescript-koa-runtime/server" -import { Params, parseRequestInput } from "@nahkies/typescript-koa-runtime/zod" +import { + Params, + parseRequestInput, + responseValidationFactory, +} from "@nahkies/typescript-koa-runtime/zod" import { Context } from "koa" import { z } from "zod" From 124b27da911655f0395fa4c570c6242d6491c6ff Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 14:38:15 +0100 Subject: [PATCH 05/10] feat: use validation factory, make response body typed --- .../src/api.github.com.yaml/generated.ts | 181116 ++++++++------- .../src/api.github.com.yaml/models.ts | 5791 +- .../src/petstore-expanded.yml/generated.ts | 92 +- .../src/petstore-expanded.yml/index.ts | 16 +- .../src/petstore-expanded.yml/models.ts | 14 + .../src/todo-lists.yml/generated.ts | 167 +- .../src/todo-lists.yml/models.ts | 14 + .../src/typescript/common/output-utils.ts | 10 +- .../abstract-schema-builder.ts | 4 + .../schema-builders/joi-schema-builder.ts | 9 + .../schema-builders/zod-schema-builder.ts | 14 + .../typescript-koa.generator.ts | 74 +- packages/typescript-koa-runtime/src/server.ts | 20 + packages/typescript-koa-runtime/src/zod.ts | 24 +- 14 files changed, 99924 insertions(+), 87441 deletions(-) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts index 1b56175de..11af81b44 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts @@ -1257,10 +1257,233 @@ import { t_UsersUnblockParamSchema, t_UsersUnfollowParamSchema, t_UsersUpdateAuthenticatedBodySchema, + t_actions_billing_usage, + t_actions_cache_list, + t_actions_cache_usage_by_repository, + t_actions_cache_usage_org_enterprise, + t_actions_get_default_workflow_permissions, + t_actions_organization_permissions, + t_actions_public_key, + t_actions_repository_permissions, + t_actions_secret, + t_actions_variable, + t_actions_workflow_access_to_repository, + t_api_overview, + t_artifact, + t_authentication_token, + t_authorization, + t_autolink, + t_base_gist, + t_basic_error, + t_blob, + t_branch_protection, + t_branch_restriction_policy, + t_branch_short, + t_branch_with_protection, + t_check_annotation, + t_check_run, + t_check_suite, + t_check_suite_preference, + t_clone_traffic, + t_code_frequency_stat, + t_code_of_conduct, + t_code_scanning_alert, + t_code_scanning_alert_instance, + t_code_scanning_alert_items, + t_code_scanning_analysis, + t_code_scanning_analysis_deletion, + t_code_scanning_codeql_database, + t_code_scanning_organization_alert_items, + t_code_scanning_sarifs_receipt, + t_code_scanning_sarifs_status, + t_code_search_result_item, + t_codeowners_errors, + t_codespace, + t_codespace_export_details, + t_codespace_machine, + t_codespace_with_full_repository, + t_codespaces_org_secret, + t_codespaces_public_key, + t_codespaces_secret, + t_codespaces_user_public_key, + t_collaborator, + t_combined_billing_usage, + t_combined_commit_status, + t_commit, + t_commit_activity, + t_commit_comment, + t_commit_comparison, + t_commit_search_result_item, + t_community_profile, + t_content_directory, + t_content_file, + t_content_submodule, + t_content_symlink, + t_content_traffic, + t_contributor, + t_contributor_activity, + t_dependabot_alert, + t_dependabot_alert_with_repository, + t_dependabot_public_key, + t_dependabot_secret, + t_dependency_graph_diff, + t_deploy_key, + t_deployment, + t_deployment_branch_policy, + t_deployment_status, + t_diff_entry, + t_email, + t_empty_object, + t_enterprise_security_analysis_settings, + t_environment, + t_environment_approvals, + t_event, + t_feed, + t_file_commit, + t_full_repository, + t_gist_comment, + t_gist_commit, + t_gist_simple, + t_git_commit, + t_git_ref, + t_git_tag, + t_git_tree, + t_gitignore_template, + t_gpg_key, + t_hook, + t_hook_delivery, + t_hook_delivery_item, + t_hovercard, + t_import, + t_installation, + t_installation_token, + t_integration, + t_interaction_limit_response, + t_issue, + t_issue_comment, + t_issue_event, + t_issue_event_for_issue, + t_issue_search_result_item, + t_job, + t_key, + t_key_simple, + t_label, + t_label_search_result_item, + t_language, + t_license, + t_license_content, + t_license_simple, + t_marketplace_listing_plan, + t_marketplace_purchase, + t_merged_upstream, + t_migration, + t_milestone, + t_minimal_repository, + t_oidc_custom_sub, + t_oidc_custom_sub_repo, + t_org_hook, + t_org_membership, + t_organization_actions_secret, + t_organization_actions_variable, + t_organization_dependabot_secret, + t_organization_full, + t_organization_invitation, + t_organization_secret_scanning_alert, + t_organization_simple, + t_package, + t_package_version, + t_packages_billing_usage, + t_page, + t_page_build, + t_page_build_status, + t_page_deployment, + t_pages_health_check, + t_participation_stats, + t_pending_deployment, + t_porter_author, + t_porter_large_file, + t_private_user, + t_project, + t_project_card, + t_project_collaborator_permission, + t_project_column, + t_protected_branch, + t_protected_branch_admin_enforced, + t_protected_branch_pull_request_review, + t_public_user, + t_pull_request, + t_pull_request_merge_result, + t_pull_request_review, + t_pull_request_review_comment, + t_pull_request_review_request, + t_pull_request_simple, + t_rate_limit_overview, + t_reaction, + t_referrer_traffic, + t_release, + t_release_asset, + t_release_notes_content, + t_repo_codespaces_secret, + t_repo_required_workflow, + t_repo_search_result_item, + t_repository, + t_repository_collaborator_permission, + t_repository_invitation, + t_repository_subscription, + t_required_workflow, + t_review_comment, + t_root, + t_runner, + t_runner_application, + t_runner_groups_enterprise, + t_runner_groups_org, + t_runner_label, + t_scim_error, + t_secret_scanning_alert, + t_secret_scanning_location, + t_selected_actions, + t_short_blob, + t_short_branch, + t_simple_user, + t_ssh_signing_key, + t_starred_repository, + t_status, + t_status_check_policy, + t_tag, + t_tag_protection, + t_team, + t_team_discussion, + t_team_discussion_comment, + t_team_full, + t_team_membership, + t_team_project, + t_team_repository, + t_team_simple, + t_thread, + t_thread_subscription, + t_timeline_issue_events, + t_topic, + t_topic_search_result_item, + t_user_marketplace_purchase, + t_user_search_result_item, + t_validation_error, + t_validation_error_simple, + t_view_traffic, + t_webhook_config, + t_workflow, + t_workflow_run, + t_workflow_run_usage, + t_workflow_usage, } from "./models" import KoaRouter from "@koa/router" import { + Response, ServerConfig, + StatusCode, + StatusCode2xx, + StatusCode3xx, + StatusCode4xx, + StatusCode5xx, startServer, } from "@nahkies/typescript-koa-runtime/server" import { @@ -1277,57 +1500,87 @@ import { z } from "zod" export type MetaRoot = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type AppsGetAuthenticated = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type AppsCreateFromManifest = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 201, + t_integration & { + client_id: string + client_secret: string + pem: string + webhook_secret: string | null + [key: string]: unknown + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type AppsGetWebhookConfigForApp = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type AppsUpdateWebhookConfigForApp = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type AppsListWebhookDeliveries = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook_delivery_item[]> + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type AppsGetWebhookDelivery = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook_delivery> + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type AppsRedeliverWebhookDelivery = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type AppsListInstallations = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type AppsGetInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type AppsDeleteInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type AppsCreateInstallationAccessToken = ( params: Params< @@ -1336,17 +1589,23 @@ export type AppsCreateInstallationAccessToken = ( t_AppsCreateInstallationAccessTokenBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_installation_token> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type AppsSuspendInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type AppsUnsuspendInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type AppsDeleteAuthorization = ( params: Params< @@ -1355,17 +1614,21 @@ export type AppsDeleteAuthorization = ( t_AppsDeleteAuthorizationBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type AppsCheckToken = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_authorization> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type AppsResetToken = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type AppsDeleteToken = ( params: Params< @@ -1374,32 +1637,54 @@ export type AppsDeleteToken = ( t_AppsDeleteTokenBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type AppsScopeToken = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_authorization> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type AppsGetBySlug = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_integration> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type CodesOfConductGetAllCodesOfConduct = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type CodesOfConductGetConductCode = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_of_conduct> + | Response<304, void> + | Response<404, t_basic_error> +> export type EmojisGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + [key: string]: unknown + } + > + | Response<304, void> +> export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise = ( params: Params< @@ -1408,7 +1693,7 @@ export type EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise = ( params: Params< @@ -1417,7 +1702,15 @@ export type EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + runner_groups: t_runner_groups_enterprise[] + total_count: number + } + > +> export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise = ( params: Params< @@ -1426,7 +1719,7 @@ export type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise = ( t_EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise = ( params: Params< @@ -1435,7 +1728,7 @@ export type EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise = ( params: Params< @@ -1444,7 +1737,7 @@ export type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise = ( params: Params< @@ -1453,7 +1746,7 @@ export type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise = ( params: Params< @@ -1462,7 +1755,7 @@ export type EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type EnterpriseAdminListLabelsForSelfHostedRunnerForEnterprise = ( params: Params< @@ -1471,7 +1764,16 @@ export type EnterpriseAdminListLabelsForSelfHostedRunnerForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type EnterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterprise = ( params: Params< @@ -1480,7 +1782,17 @@ export type EnterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterprise = ( t_EnterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterpriseBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type SecretScanningGetSecurityAnalysisSettingsForEnterprise = ( params: Params< @@ -1489,7 +1801,10 @@ export type SecretScanningGetSecurityAnalysisSettingsForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_enterprise_security_analysis_settings> + | Response<404, t_basic_error> +> export type SecretScanningPatchSecurityAnalysisSettingsForEnterprise = ( params: Params< @@ -1499,7 +1814,9 @@ export type SecretScanningPatchSecurityAnalysisSettingsForEnterprise = ( | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<204, void> | Response<404, t_basic_error> | Response<422, void> +> export type DependabotListAlertsForEnterprise = ( params: Params< @@ -1508,7 +1825,13 @@ export type DependabotListAlertsForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_dependabot_alert_with_repository[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type SecretScanningListAlertsForEnterprise = ( params: Params< @@ -1517,7 +1840,18 @@ export type SecretScanningListAlertsForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_organization_secret_scanning_alert[]> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SecretScanningPostSecurityProductEnablementForEnterprise = ( params: Params< @@ -1526,52 +1860,111 @@ export type SecretScanningPostSecurityProductEnablementForEnterprise = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<204, void> | Response<404, t_basic_error> | Response<422, void> +> export type ActivityListPublicEvents = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_event[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type ActivityGetFeeds = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type GistsList = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_base_gist[]> + | Response<304, void> + | Response<403, t_basic_error> +> export type GistsCreate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_gist_simple> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GistsListPublic = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_base_gist[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type GistsListStarred = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_base_gist[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type GistsGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_simple> + | Response<304, void> + | Response< + 403, + { + block?: { + created_at?: string + html_url?: string | null + reason?: string + } + documentation_url?: string + message?: string + } + > + | Response<404, t_basic_error> +> export type GistsUpdate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_simple> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GistsDelete = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsListComments = ( params: Params< @@ -1580,7 +1973,12 @@ export type GistsListComments = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_comment[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsCreateComment = ( params: Params< @@ -1589,12 +1987,33 @@ export type GistsCreateComment = ( t_GistsCreateCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_gist_comment> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsGetComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_comment> + | Response<304, void> + | Response< + 403, + { + block?: { + created_at?: string + html_url?: string | null + reason?: string + } + documentation_url?: string + message?: string + } + > + | Response<404, t_basic_error> +> export type GistsUpdateComment = ( params: Params< @@ -1603,12 +2022,17 @@ export type GistsUpdateComment = ( t_GistsUpdateCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type GistsDeleteComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsListCommits = ( params: Params< @@ -1617,7 +2041,12 @@ export type GistsListCommits = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_commit[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsListForks = ( params: Params< @@ -1626,42 +2055,78 @@ export type GistsListForks = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_simple[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsFork = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_base_gist> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GistsCheckIsStarred = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response< + 404, + { + [key: string]: unknown + } + > +> export type GistsStar = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsUnstar = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type GistsGetRevision = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gist_simple> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GitignoreGetAllTemplates = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type GitignoreGetTemplate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type AppsListReposAccessibleToInstallation = ( params: Params< @@ -1670,47 +2135,77 @@ export type AppsListReposAccessibleToInstallation = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + repositories: t_repository[] + repository_selection?: string + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type AppsRevokeInstallationAccessToken = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesList = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue[]> + | Response<304, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type LicensesGetAllCommonlyUsed = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type LicensesGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_license> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type MarkdownRender = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type MarkdownRenderRaw = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type AppsGetSubscriptionPlanForAccount = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_marketplace_purchase> + | Response<401, t_basic_error> + | Response<404, t_basic_error> +> export type AppsListPlans = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_marketplace_listing_plan[]> + | Response<401, t_basic_error> + | Response<404, t_basic_error> +> export type AppsListAccountsForPlan = ( params: Params< @@ -1719,7 +2214,12 @@ export type AppsListAccountsForPlan = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_marketplace_purchase[]> + | Response<401, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type AppsGetSubscriptionPlanForAccountStubbed = ( params: Params< @@ -1728,12 +2228,18 @@ export type AppsGetSubscriptionPlanForAccountStubbed = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_marketplace_purchase> + | Response<401, t_basic_error> + | Response<404, void> +> export type AppsListPlansStubbed = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_marketplace_listing_plan[]> | Response<401, t_basic_error> +> export type AppsListAccountsForPlanStubbed = ( params: Params< @@ -1742,12 +2248,14 @@ export type AppsListAccountsForPlanStubbed = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_marketplace_purchase[]> | Response<401, t_basic_error> +> export type MetaGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type ActivityListPublicEventsForRepoNetwork = ( params: Params< @@ -1756,7 +2264,13 @@ export type ActivityListPublicEventsForRepoNetwork = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_event[]> + | Response<301, t_basic_error> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActivityListNotificationsForAuthenticatedUser = ( params: Params< @@ -1765,7 +2279,13 @@ export type ActivityListNotificationsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_thread[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type ActivityMarkNotificationsAsRead = ( params: Params< @@ -1774,17 +2294,35 @@ export type ActivityMarkNotificationsAsRead = ( t_ActivityMarkNotificationsAsReadBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + message?: string + } + > + | Response<205, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ActivityGetThread = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_thread> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ActivityMarkThreadAsRead = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<205, void> | Response<304, void> | Response<403, t_basic_error> +> export type ActivityGetThreadSubscriptionForAuthenticatedUser = ( params: Params< @@ -1793,7 +2331,12 @@ export type ActivityGetThreadSubscriptionForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_thread_subscription> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ActivitySetThreadSubscription = ( params: Params< @@ -1802,27 +2345,37 @@ export type ActivitySetThreadSubscription = ( t_ActivitySetThreadSubscriptionBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_thread_subscription> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ActivityDeleteThreadSubscription = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type MetaGetOctocat = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsList = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type OrgsGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type OrgsUpdate = ( params: Params< @@ -1831,12 +2384,16 @@ export type OrgsUpdate = ( t_OrgsUpdateBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_organization_full> + | Response<409, t_basic_error> + | Response<422, t_validation_error | t_validation_error_simple> +> export type ActionsGetActionsCacheUsageForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetActionsCacheUsageByRepoForOrg = ( params: Params< @@ -1845,12 +2402,20 @@ export type ActionsGetActionsCacheUsageByRepoForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + repository_cache_usages: t_actions_cache_usage_by_repository[] + total_count: number + } + > +> export type OidcGetOidcCustomSubTemplateForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OidcUpdateOidcCustomSubTemplateForOrg = ( params: Params< @@ -1859,7 +2424,11 @@ export type OidcUpdateOidcCustomSubTemplateForOrg = ( t_OidcUpdateOidcCustomSubTemplateForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_empty_object> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActionsGetGithubActionsPermissionsOrganization = ( params: Params< @@ -1868,7 +2437,7 @@ export type ActionsGetGithubActionsPermissionsOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetGithubActionsPermissionsOrganization = ( params: Params< @@ -1877,7 +2446,7 @@ export type ActionsSetGithubActionsPermissionsOrganization = ( t_ActionsSetGithubActionsPermissionsOrganizationBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganization = ( params: Params< @@ -1886,7 +2455,15 @@ export type ActionsListSelectedRepositoriesEnabledGithubActionsOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + repositories: t_repository[] + total_count: number + } + > +> export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization = ( params: Params< @@ -1895,7 +2472,7 @@ export type ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization = ( t_ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsEnableSelectedRepositoryGithubActionsOrganization = ( params: Params< @@ -1904,7 +2481,7 @@ export type ActionsEnableSelectedRepositoryGithubActionsOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDisableSelectedRepositoryGithubActionsOrganization = ( params: Params< @@ -1913,12 +2490,12 @@ export type ActionsDisableSelectedRepositoryGithubActionsOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetAllowedActionsOrganization = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetAllowedActionsOrganization = ( params: Params< @@ -1927,7 +2504,7 @@ export type ActionsSetAllowedActionsOrganization = ( t_ActionsSetAllowedActionsOrganizationBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization = ( params: Params< @@ -1936,7 +2513,7 @@ export type ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization = ( params: Params< @@ -1946,7 +2523,7 @@ export type ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization = ( | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActionsListRequiredWorkflows = ( params: Params< @@ -1955,7 +2532,15 @@ export type ActionsListRequiredWorkflows = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + required_workflows: t_required_workflow[] + total_count: number + } + > +> export type ActionsCreateRequiredWorkflow = ( params: Params< @@ -1964,12 +2549,14 @@ export type ActionsCreateRequiredWorkflow = ( t_ActionsCreateRequiredWorkflowBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<201, t_required_workflow> | Response<422, t_validation_error_simple> +> export type ActionsGetRequiredWorkflow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsUpdateRequiredWorkflow = ( params: Params< @@ -1978,12 +2565,14 @@ export type ActionsUpdateRequiredWorkflow = ( t_ActionsUpdateRequiredWorkflowBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_required_workflow> | Response<422, t_validation_error_simple> +> export type ActionsDeleteRequiredWorkflow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListSelectedRepositoriesRequiredWorkflow = ( params: Params< @@ -1992,7 +2581,16 @@ export type ActionsListSelectedRepositoriesRequiredWorkflow = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + repositories: t_repository[] + total_count: number + } + > + | Response<404, void> +> export type ActionsSetSelectedReposToRequiredWorkflow = ( params: Params< @@ -2001,7 +2599,7 @@ export type ActionsSetSelectedReposToRequiredWorkflow = ( t_ActionsSetSelectedReposToRequiredWorkflowBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsAddSelectedRepoToRequiredWorkflow = ( params: Params< @@ -2010,7 +2608,7 @@ export type ActionsAddSelectedRepoToRequiredWorkflow = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void> | Response<422, void>> export type ActionsRemoveSelectedRepoFromRequiredWorkflow = ( params: Params< @@ -2019,7 +2617,7 @@ export type ActionsRemoveSelectedRepoFromRequiredWorkflow = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void> | Response<422, void>> export type ActionsListSelfHostedRunnerGroupsForOrg = ( params: Params< @@ -2028,7 +2626,15 @@ export type ActionsListSelfHostedRunnerGroupsForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + runner_groups: t_runner_groups_org[] + total_count: number + } + > +> export type ActionsCreateSelfHostedRunnerGroupForOrg = ( params: Params< @@ -2037,7 +2643,7 @@ export type ActionsCreateSelfHostedRunnerGroupForOrg = ( t_ActionsCreateSelfHostedRunnerGroupForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetSelfHostedRunnerGroupForOrg = ( params: Params< @@ -2046,7 +2652,7 @@ export type ActionsGetSelfHostedRunnerGroupForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsUpdateSelfHostedRunnerGroupForOrg = ( params: Params< @@ -2055,7 +2661,7 @@ export type ActionsUpdateSelfHostedRunnerGroupForOrg = ( t_ActionsUpdateSelfHostedRunnerGroupForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteSelfHostedRunnerGroupFromOrg = ( params: Params< @@ -2064,7 +2670,7 @@ export type ActionsDeleteSelfHostedRunnerGroupFromOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrg = ( params: Params< @@ -2073,7 +2679,15 @@ export type ActionsListRepoAccessToSelfHostedRunnerGroupInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + repositories: t_minimal_repository[] + total_count: number + } + > +> export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg = ( params: Params< @@ -2082,7 +2696,7 @@ export type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg = ( t_ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg = ( params: Params< @@ -2091,7 +2705,7 @@ export type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListSelfHostedRunnersInGroupForOrg = ( params: Params< @@ -2100,7 +2714,15 @@ export type ActionsListSelfHostedRunnersInGroupForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + runners: t_runner[] + total_count: number + } + > +> export type ActionsSetSelfHostedRunnersInGroupForOrg = ( params: Params< @@ -2109,7 +2731,7 @@ export type ActionsSetSelfHostedRunnersInGroupForOrg = ( t_ActionsSetSelfHostedRunnersInGroupForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsAddSelfHostedRunnerToGroupForOrg = ( params: Params< @@ -2118,7 +2740,7 @@ export type ActionsAddSelfHostedRunnerToGroupForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsRemoveSelfHostedRunnerFromGroupForOrg = ( params: Params< @@ -2127,7 +2749,7 @@ export type ActionsRemoveSelfHostedRunnerFromGroupForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListSelfHostedRunnersForOrg = ( params: Params< @@ -2136,32 +2758,40 @@ export type ActionsListSelfHostedRunnersForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + runners: t_runner[] + total_count: number + } + > +> export type ActionsListRunnerApplicationsForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateRegistrationTokenForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateRemoveTokenForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetSelfHostedRunnerForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteSelfHostedRunnerFromOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListLabelsForSelfHostedRunnerForOrg = ( params: Params< @@ -2170,7 +2800,16 @@ export type ActionsListLabelsForSelfHostedRunnerForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type ActionsAddCustomLabelsToSelfHostedRunnerForOrg = ( params: Params< @@ -2179,7 +2818,17 @@ export type ActionsAddCustomLabelsToSelfHostedRunnerForOrg = ( t_ActionsAddCustomLabelsToSelfHostedRunnerForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsSetCustomLabelsForSelfHostedRunnerForOrg = ( params: Params< @@ -2188,7 +2837,17 @@ export type ActionsSetCustomLabelsForSelfHostedRunnerForOrg = ( t_ActionsSetCustomLabelsForSelfHostedRunnerForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg = ( params: Params< @@ -2197,7 +2856,16 @@ export type ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg = ( params: Params< @@ -2206,7 +2874,17 @@ export type ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsListOrgSecrets = ( params: Params< @@ -2215,17 +2893,25 @@ export type ActionsListOrgSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_organization_actions_secret[] + total_count: number + } + > +> export type ActionsGetOrgPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateOrUpdateOrgSecret = ( params: Params< @@ -2234,12 +2920,12 @@ export type ActionsCreateOrUpdateOrgSecret = ( t_ActionsCreateOrUpdateOrgSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type ActionsDeleteOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListSelectedReposForOrgSecret = ( params: Params< @@ -2248,7 +2934,15 @@ export type ActionsListSelectedReposForOrgSecret = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + repositories: t_minimal_repository[] + total_count: number + } + > +> export type ActionsSetSelectedReposForOrgSecret = ( params: Params< @@ -2257,12 +2951,12 @@ export type ActionsSetSelectedReposForOrgSecret = ( t_ActionsSetSelectedReposForOrgSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsAddSelectedRepoToOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActionsRemoveSelectedRepoFromOrgSecret = ( params: Params< @@ -2271,7 +2965,7 @@ export type ActionsRemoveSelectedRepoFromOrgSecret = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActionsListOrgVariables = ( params: Params< @@ -2280,7 +2974,15 @@ export type ActionsListOrgVariables = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + variables: t_organization_actions_variable[] + } + > +> export type ActionsCreateOrgVariable = ( params: Params< @@ -2289,12 +2991,12 @@ export type ActionsCreateOrgVariable = ( t_ActionsCreateOrgVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetOrgVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsUpdateOrgVariable = ( params: Params< @@ -2303,12 +3005,12 @@ export type ActionsUpdateOrgVariable = ( t_ActionsUpdateOrgVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteOrgVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListSelectedReposForOrgVariable = ( params: Params< @@ -2317,7 +3019,16 @@ export type ActionsListSelectedReposForOrgVariable = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + repositories: t_minimal_repository[] + total_count: number + } + > + | Response<409, void> +> export type ActionsSetSelectedReposForOrgVariable = ( params: Params< @@ -2326,12 +3037,12 @@ export type ActionsSetSelectedReposForOrgVariable = ( t_ActionsSetSelectedReposForOrgVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActionsAddSelectedRepoToOrgVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActionsRemoveSelectedRepoFromOrgVariable = ( params: Params< @@ -2340,7 +3051,7 @@ export type ActionsRemoveSelectedRepoFromOrgVariable = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type OrgsListBlockedUsers = ( params: Params< @@ -2349,22 +3060,22 @@ export type OrgsListBlockedUsers = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsCheckBlockedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type OrgsBlockUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type OrgsUnblockUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodeScanningListAlertsForOrg = ( params: Params< @@ -2373,7 +3084,18 @@ export type CodeScanningListAlertsForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_organization_alert_items[]> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodespacesListInOrganization = ( params: Params< @@ -2382,7 +3104,20 @@ export type CodespacesListInOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + codespaces: t_codespace[] + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesSetCodespacesBilling = ( params: Params< @@ -2391,7 +3126,14 @@ export type CodespacesSetCodespacesBilling = ( t_CodespacesSetCodespacesBillingBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<400, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> + | Response<500, t_basic_error> +> export type CodespacesListOrgSecrets = ( params: Params< @@ -2400,17 +3142,25 @@ export type CodespacesListOrgSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_codespaces_org_secret[] + total_count: number + } + > +> export type CodespacesGetOrgPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesGetOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesCreateOrUpdateOrgSecret = ( params: Params< @@ -2419,12 +3169,17 @@ export type CodespacesCreateOrUpdateOrgSecret = ( t_CodespacesCreateOrUpdateOrgSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_empty_object> + | Response<204, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type CodespacesDeleteOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type CodespacesListSelectedReposForOrgSecret = ( params: Params< @@ -2433,7 +3188,16 @@ export type CodespacesListSelectedReposForOrgSecret = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + repositories: t_minimal_repository[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type CodespacesSetSelectedReposForOrgSecret = ( params: Params< @@ -2442,12 +3206,19 @@ export type CodespacesSetSelectedReposForOrgSecret = ( t_CodespacesSetSelectedReposForOrgSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<204, void> | Response<404, t_basic_error> | Response<409, void> +> export type CodespacesAddSelectedRepoToOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<409, void> + | Response<422, t_validation_error> +> export type CodespacesRemoveSelectedRepoFromOrgSecret = ( params: Params< @@ -2456,7 +3227,12 @@ export type CodespacesRemoveSelectedRepoFromOrgSecret = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<409, void> + | Response<422, t_validation_error> +> export type DependabotListAlertsForOrg = ( params: Params< @@ -2465,7 +3241,14 @@ export type DependabotListAlertsForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_dependabot_alert_with_repository[]> + | Response<304, void> + | Response<400, t_scim_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type DependabotListOrgSecrets = ( params: Params< @@ -2474,17 +3257,25 @@ export type DependabotListOrgSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_organization_dependabot_secret[] + total_count: number + } + > +> export type DependabotGetOrgPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependabotGetOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependabotCreateOrUpdateOrgSecret = ( params: Params< @@ -2493,12 +3284,12 @@ export type DependabotCreateOrUpdateOrgSecret = ( t_DependabotCreateOrUpdateOrgSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type DependabotDeleteOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependabotListSelectedReposForOrgSecret = ( params: Params< @@ -2507,7 +3298,15 @@ export type DependabotListSelectedReposForOrgSecret = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + repositories: t_minimal_repository[] + total_count: number + } + > +> export type DependabotSetSelectedReposForOrgSecret = ( params: Params< @@ -2516,12 +3315,12 @@ export type DependabotSetSelectedReposForOrgSecret = ( t_DependabotSetSelectedReposForOrgSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependabotAddSelectedRepoToOrgSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type DependabotRemoveSelectedRepoFromOrgSecret = ( params: Params< @@ -2530,7 +3329,7 @@ export type DependabotRemoveSelectedRepoFromOrgSecret = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActivityListPublicOrgEvents = ( params: Params< @@ -2539,7 +3338,7 @@ export type ActivityListPublicOrgEvents = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsListFailedInvitations = ( params: Params< @@ -2548,7 +3347,9 @@ export type OrgsListFailedInvitations = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_organization_invitation[]> | Response<404, t_basic_error> +> export type OrgsListWebhooks = ( params: Params< @@ -2557,7 +3358,7 @@ export type OrgsListWebhooks = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type OrgsCreateWebhook = ( params: Params< @@ -2566,12 +3367,16 @@ export type OrgsCreateWebhook = ( t_OrgsCreateWebhookBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_org_hook> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type OrgsGetWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type OrgsUpdateWebhook = ( params: Params< @@ -2580,17 +3385,21 @@ export type OrgsUpdateWebhook = ( t_OrgsUpdateWebhookBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_org_hook> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type OrgsDeleteWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type OrgsGetWebhookConfigForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsUpdateWebhookConfigForOrg = ( params: Params< @@ -2599,7 +3408,7 @@ export type OrgsUpdateWebhookConfigForOrg = ( t_OrgsUpdateWebhookConfigForOrgBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsListWebhookDeliveries = ( params: Params< @@ -2608,27 +3417,44 @@ export type OrgsListWebhookDeliveries = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook_delivery_item[]> + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type OrgsGetWebhookDelivery = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook_delivery> + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type OrgsRedeliverWebhookDelivery = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type OrgsPingWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type AppsGetOrgInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsListAppInstallations = ( params: Params< @@ -2637,12 +3463,27 @@ export type OrgsListAppInstallations = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + installations: t_installation[] + total_count: number + } + > +> export type InteractionsGetRestrictionsForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + [key: string]: unknown + } + > +> export type InteractionsSetRestrictionsForOrg = ( params: Params< @@ -2651,12 +3492,15 @@ export type InteractionsSetRestrictionsForOrg = ( t_InteractionsSetRestrictionsForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_interaction_limit_response> + | Response<422, t_validation_error> +> export type InteractionsRemoveRestrictionsForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsListPendingInvitations = ( params: Params< @@ -2665,7 +3509,9 @@ export type OrgsListPendingInvitations = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_organization_invitation[]> | Response<404, t_basic_error> +> export type OrgsCreateInvitation = ( params: Params< @@ -2674,12 +3520,20 @@ export type OrgsCreateInvitation = ( t_OrgsCreateInvitationBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_organization_invitation> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type OrgsCancelInvitation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type OrgsListInvitationTeams = ( params: Params< @@ -2688,7 +3542,7 @@ export type OrgsListInvitationTeams = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesListForOrg = ( params: Params< @@ -2697,7 +3551,7 @@ export type IssuesListForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type OrgsListMembers = ( params: Params< @@ -2706,17 +3560,17 @@ export type OrgsListMembers = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type OrgsCheckMembershipForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<302, void> | Response<404, void>> export type OrgsRemoveMember = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type CodespacesGetCodespacesForUserInOrg = ( params: Params< @@ -2725,22 +3579,58 @@ export type CodespacesGetCodespacesForUserInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + codespaces: t_codespace[] + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesDeleteFromOrganization = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesStopInOrganization = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_codespace> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type OrgsGetMembershipForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_org_membership> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type OrgsSetMembershipForUser = ( params: Params< @@ -2749,12 +3639,20 @@ export type OrgsSetMembershipForUser = ( t_OrgsSetMembershipForUserBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_org_membership> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type OrgsRemoveMembershipForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type MigrationsListForOrg = ( params: Params< @@ -2763,7 +3661,7 @@ export type MigrationsListForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type MigrationsStartForOrg = ( params: Params< @@ -2772,7 +3670,11 @@ export type MigrationsStartForOrg = ( t_MigrationsStartForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_migration> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type MigrationsGetStatusForOrg = ( params: Params< @@ -2781,22 +3683,22 @@ export type MigrationsGetStatusForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type MigrationsDownloadArchiveForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type MigrationsDeleteArchiveForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type MigrationsUnlockRepoForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type MigrationsListReposForOrg = ( params: Params< @@ -2805,7 +3707,9 @@ export type MigrationsListReposForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_minimal_repository[]> | Response<404, t_basic_error> +> export type OrgsListOutsideCollaborators = ( params: Params< @@ -2814,7 +3718,7 @@ export type OrgsListOutsideCollaborators = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsConvertMemberToOutsideCollaborator = ( params: Params< @@ -2823,12 +3727,31 @@ export type OrgsConvertMemberToOutsideCollaborator = ( t_OrgsConvertMemberToOutsideCollaboratorBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<204, void> + | Response<403, void> + | Response<404, t_basic_error> +> export type OrgsRemoveOutsideCollaborator = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response< + 422, + { + documentation_url?: string + message?: string + } + > +> export type PackagesListPackagesForOrganization = ( params: Params< @@ -2837,17 +3760,26 @@ export type PackagesListPackagesForOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_package[]> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type PackagesGetPackageForOrganization = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesDeletePackageForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesRestorePackageForOrg = ( params: Params< @@ -2856,7 +3788,12 @@ export type PackagesRestorePackageForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesGetAllPackageVersionsForPackageOwnedByOrg = ( params: Params< @@ -2865,7 +3802,12 @@ export type PackagesGetAllPackageVersionsForPackageOwnedByOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_package_version[]> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesGetPackageVersionForOrganization = ( params: Params< @@ -2874,17 +3816,27 @@ export type PackagesGetPackageVersionForOrganization = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesDeletePackageVersionForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesRestorePackageVersionForOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ProjectsListForOrg = ( params: Params< @@ -2893,7 +3845,9 @@ export type ProjectsListForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_project[]> | Response<422, t_validation_error_simple> +> export type ProjectsCreateForOrg = ( params: Params< @@ -2902,7 +3856,14 @@ export type ProjectsCreateForOrg = ( t_ProjectsCreateForOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_project> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error_simple> +> export type OrgsListPublicMembers = ( params: Params< @@ -2911,12 +3872,12 @@ export type OrgsListPublicMembers = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsCheckPublicMembershipForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type OrgsSetPublicMembershipForAuthenticatedUser = ( params: Params< @@ -2925,7 +3886,7 @@ export type OrgsSetPublicMembershipForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type OrgsRemovePublicMembershipForAuthenticatedUser = ( params: Params< @@ -2934,7 +3895,7 @@ export type OrgsRemovePublicMembershipForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListForOrg = ( params: Params< @@ -2943,7 +3904,7 @@ export type ReposListForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateInOrg = ( params: Params< @@ -2952,7 +3913,11 @@ export type ReposCreateInOrg = ( t_ReposCreateInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_repository> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type SecretScanningListAlertsForOrg = ( params: Params< @@ -2961,52 +3926,67 @@ export type SecretScanningListAlertsForOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_organization_secret_scanning_alert[]> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type OrgsListSecurityManagerTeams = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsAddSecurityManagerTeam = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type OrgsRemoveSecurityManagerTeam = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type BillingGetGithubActionsBillingOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type BillingGetGithubPackagesBillingOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type BillingGetSharedStorageBillingOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsList = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type TeamsCreate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_team_full> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsGetByName = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type TeamsUpdateInOrg = ( params: Params< @@ -3015,12 +3995,18 @@ export type TeamsUpdateInOrg = ( t_TeamsUpdateInOrgBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_team_full> + | Response<201, t_team_full> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsDeleteInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListDiscussionsInOrg = ( params: Params< @@ -3029,7 +4015,7 @@ export type TeamsListDiscussionsInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsCreateDiscussionInOrg = ( params: Params< @@ -3038,12 +4024,12 @@ export type TeamsCreateDiscussionInOrg = ( t_TeamsCreateDiscussionInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsGetDiscussionInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsUpdateDiscussionInOrg = ( params: Params< @@ -3052,12 +4038,12 @@ export type TeamsUpdateDiscussionInOrg = ( t_TeamsUpdateDiscussionInOrgBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsDeleteDiscussionInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListDiscussionCommentsInOrg = ( params: Params< @@ -3066,7 +4052,7 @@ export type TeamsListDiscussionCommentsInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsCreateDiscussionCommentInOrg = ( params: Params< @@ -3075,12 +4061,12 @@ export type TeamsCreateDiscussionCommentInOrg = ( t_TeamsCreateDiscussionCommentInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsGetDiscussionCommentInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsUpdateDiscussionCommentInOrg = ( params: Params< @@ -3089,12 +4075,12 @@ export type TeamsUpdateDiscussionCommentInOrg = ( t_TeamsUpdateDiscussionCommentInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsDeleteDiscussionCommentInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsListForTeamDiscussionCommentInOrg = ( params: Params< @@ -3103,7 +4089,7 @@ export type ReactionsListForTeamDiscussionCommentInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsCreateForTeamDiscussionCommentInOrg = ( params: Params< @@ -3112,7 +4098,7 @@ export type ReactionsCreateForTeamDiscussionCommentInOrg = ( t_ReactionsCreateForTeamDiscussionCommentInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<201, t_reaction>> export type ReactionsDeleteForTeamDiscussionComment = ( params: Params< @@ -3121,7 +4107,7 @@ export type ReactionsDeleteForTeamDiscussionComment = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsListForTeamDiscussionInOrg = ( params: Params< @@ -3130,7 +4116,7 @@ export type ReactionsListForTeamDiscussionInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsCreateForTeamDiscussionInOrg = ( params: Params< @@ -3139,12 +4125,12 @@ export type ReactionsCreateForTeamDiscussionInOrg = ( t_ReactionsCreateForTeamDiscussionInOrgBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<201, t_reaction>> export type ReactionsDeleteForTeamDiscussion = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListPendingInvitationsInOrg = ( params: Params< @@ -3153,7 +4139,7 @@ export type TeamsListPendingInvitationsInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListMembersInOrg = ( params: Params< @@ -3162,12 +4148,12 @@ export type TeamsListMembersInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsGetMembershipForUserInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type TeamsAddOrUpdateMembershipForUserInOrg = ( params: Params< @@ -3176,12 +4162,14 @@ export type TeamsAddOrUpdateMembershipForUserInOrg = ( t_TeamsAddOrUpdateMembershipForUserInOrgBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_team_membership> | Response<403, void> | Response<422, void> +> export type TeamsRemoveMembershipForUserInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, void>> export type TeamsListProjectsInOrg = ( params: Params< @@ -3190,12 +4178,12 @@ export type TeamsListProjectsInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsCheckPermissionsForProjectInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type TeamsAddOrUpdateProjectPermissionsInOrg = ( params: Params< @@ -3204,12 +4192,21 @@ export type TeamsAddOrUpdateProjectPermissionsInOrg = ( t_TeamsAddOrUpdateProjectPermissionsInOrgBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response< + 403, + { + documentation_url?: string + message?: string + } + > +> export type TeamsRemoveProjectInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListReposInOrg = ( params: Params< @@ -3218,12 +4215,14 @@ export type TeamsListReposInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsCheckPermissionsForRepoInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_team_repository> | Response<204, void> | Response<404, void> +> export type TeamsAddOrUpdateRepoPermissionsInOrg = ( params: Params< @@ -3232,12 +4231,12 @@ export type TeamsAddOrUpdateRepoPermissionsInOrg = ( t_TeamsAddOrUpdateRepoPermissionsInOrgBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsRemoveRepoInOrg = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListChildInOrg = ( params: Params< @@ -3246,7 +4245,7 @@ export type TeamsListChildInOrg = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsEnableOrDisableSecurityProductOnAllOrgRepos = ( params: Params< @@ -3255,12 +4254,18 @@ export type OrgsEnableOrDisableSecurityProductOnAllOrgRepos = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, void>> export type ProjectsGetCard = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_card> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ProjectsUpdateCard = ( params: Params< @@ -3269,12 +4274,32 @@ export type ProjectsUpdateCard = ( t_ProjectsUpdateCardBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_card> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ProjectsDeleteCard = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response< + 403, + { + documentation_url?: string + errors?: string[] + message?: string + } + > + | Response<404, t_basic_error> +> export type ProjectsMoveCard = ( params: Params< @@ -3283,12 +4308,53 @@ export type ProjectsMoveCard = ( t_ProjectsMoveCardBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 201, + { + [key: string]: unknown + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response< + 403, + { + documentation_url?: string + errors?: { + code?: string + field?: string + message?: string + resource?: string + }[] + message?: string + } + > + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + errors?: { + code?: string + message?: string + }[] + message?: string + } + > +> export type ProjectsGetColumn = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_column> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ProjectsUpdateColumn = ( params: Params< @@ -3297,12 +4363,22 @@ export type ProjectsUpdateColumn = ( t_ProjectsUpdateColumnBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_column> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ProjectsDeleteColumn = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ProjectsListCards = ( params: Params< @@ -3311,7 +4387,12 @@ export type ProjectsListCards = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_card[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ProjectsCreateCard = ( params: Params< @@ -3320,7 +4401,25 @@ export type ProjectsCreateCard = ( t_ProjectsCreateCardBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_project_card> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error | t_validation_error_simple> + | Response< + 503, + { + code?: string + documentation_url?: string + errors?: { + code?: string + message?: string + }[] + message?: string + } + > +> export type ProjectsMoveColumn = ( params: Params< @@ -3329,12 +4428,28 @@ export type ProjectsMoveColumn = ( t_ProjectsMoveColumnBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 201, + { + [key: string]: unknown + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ProjectsGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ProjectsUpdate = ( params: Params< @@ -3343,12 +4458,41 @@ export type ProjectsUpdate = ( t_ProjectsUpdateBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project> + | Response<304, void> + | Response<401, t_basic_error> + | Response< + 403, + { + documentation_url?: string + errors?: string[] + message?: string + } + > + | Response<404, void> + | Response<410, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ProjectsDelete = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response< + 403, + { + documentation_url?: string + errors?: string[] + message?: string + } + > + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type ProjectsListCollaborators = ( params: Params< @@ -3357,7 +4501,14 @@ export type ProjectsListCollaborators = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_simple_user[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ProjectsAddCollaborator = ( params: Params< @@ -3366,17 +4517,38 @@ export type ProjectsAddCollaborator = ( t_ProjectsAddCollaboratorBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ProjectsRemoveCollaborator = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ProjectsGetPermissionForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_collaborator_permission> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ProjectsListColumns = ( params: Params< @@ -3385,7 +4557,12 @@ export type ProjectsListColumns = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project_column[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ProjectsCreateColumn = ( params: Params< @@ -3394,12 +4571,22 @@ export type ProjectsCreateColumn = ( t_ProjectsCreateColumnBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_project_column> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error_simple> +> export type RateLimitGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_rate_limit_overview> + | Response<304, void> + | Response<404, t_basic_error> +> export type ActionsListRepoRequiredWorkflows = ( params: Params< @@ -3408,22 +4595,38 @@ export type ActionsListRepoRequiredWorkflows = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + required_workflows: t_repo_required_workflow[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type ActionsGetRepoRequiredWorkflow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_repo_required_workflow> | Response<404, t_basic_error> +> export type ActionsGetRepoRequiredWorkflowUsage = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_full_repository> + | Response<301, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposUpdate = ( params: Params< @@ -3432,12 +4635,29 @@ export type ReposUpdate = ( t_ReposUpdateBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_full_repository> + | Response<307, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposDelete = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<307, t_basic_error> + | Response< + 403, + { + documentation_url?: string + message?: string + } + > + | Response<404, t_basic_error> +> export type ActionsListArtifactsForRepo = ( params: Params< @@ -3446,27 +4666,35 @@ export type ActionsListArtifactsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + artifacts: t_artifact[] + total_count: number + } + > +> export type ActionsGetArtifact = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteArtifact = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDownloadArtifact = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<410, t_basic_error>> export type ActionsGetActionsCacheUsage = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetActionsCacheList = ( params: Params< @@ -3475,7 +4703,7 @@ export type ActionsGetActionsCacheList = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteActionsCacheByKey = ( params: Params< @@ -3484,22 +4712,22 @@ export type ActionsDeleteActionsCacheByKey = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteActionsCacheById = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetJobForWorkflowRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDownloadJobLogsForWorkflowRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsReRunJobForWorkflowRun = ( params: Params< @@ -3508,12 +4736,16 @@ export type ActionsReRunJobForWorkflowRun = ( t_ActionsReRunJobForWorkflowRunBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type ActionsGetCustomOidcSubClaimForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_oidc_custom_sub_repo> + | Response<400, t_scim_error> + | Response<404, t_basic_error> +> export type ActionsSetCustomOidcSubClaimForRepo = ( params: Params< @@ -3522,7 +4754,12 @@ export type ActionsSetCustomOidcSubClaimForRepo = ( t_ActionsSetCustomOidcSubClaimForRepoBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_empty_object> + | Response<400, t_scim_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsGetGithubActionsPermissionsRepository = ( params: Params< @@ -3531,7 +4768,7 @@ export type ActionsGetGithubActionsPermissionsRepository = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetGithubActionsPermissionsRepository = ( params: Params< @@ -3540,12 +4777,12 @@ export type ActionsSetGithubActionsPermissionsRepository = ( t_ActionsSetGithubActionsPermissionsRepositoryBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetWorkflowAccessToRepository = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetWorkflowAccessToRepository = ( params: Params< @@ -3554,12 +4791,12 @@ export type ActionsSetWorkflowAccessToRepository = ( t_ActionsSetWorkflowAccessToRepositoryBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetAllowedActionsRepository = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetAllowedActionsRepository = ( params: Params< @@ -3568,7 +4805,7 @@ export type ActionsSetAllowedActionsRepository = ( t_ActionsSetAllowedActionsRepositoryBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetGithubActionsDefaultWorkflowPermissionsRepository = ( params: Params< @@ -3577,7 +4814,7 @@ export type ActionsGetGithubActionsDefaultWorkflowPermissionsRepository = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsSetGithubActionsDefaultWorkflowPermissionsRepository = ( params: Params< @@ -3586,7 +4823,7 @@ export type ActionsSetGithubActionsDefaultWorkflowPermissionsRepository = ( t_ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ActionsListRequiredWorkflowRuns = ( params: Params< @@ -3595,7 +4832,15 @@ export type ActionsListRequiredWorkflowRuns = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + workflow_runs: t_workflow_run[] + } + > +> export type ActionsListSelfHostedRunnersForRepo = ( params: Params< @@ -3604,12 +4849,20 @@ export type ActionsListSelfHostedRunnersForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + runners: t_runner[] + total_count: number + } + > +> export type ActionsListRunnerApplicationsForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateRegistrationTokenForRepo = ( params: Params< @@ -3618,17 +4871,17 @@ export type ActionsCreateRegistrationTokenForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateRemoveTokenForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetSelfHostedRunnerForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteSelfHostedRunnerFromRepo = ( params: Params< @@ -3637,7 +4890,7 @@ export type ActionsDeleteSelfHostedRunnerFromRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListLabelsForSelfHostedRunnerForRepo = ( params: Params< @@ -3646,7 +4899,16 @@ export type ActionsListLabelsForSelfHostedRunnerForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type ActionsAddCustomLabelsToSelfHostedRunnerForRepo = ( params: Params< @@ -3655,7 +4917,17 @@ export type ActionsAddCustomLabelsToSelfHostedRunnerForRepo = ( t_ActionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsSetCustomLabelsForSelfHostedRunnerForRepo = ( params: Params< @@ -3664,7 +4936,17 @@ export type ActionsSetCustomLabelsForSelfHostedRunnerForRepo = ( t_ActionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo = ( params: Params< @@ -3673,7 +4955,16 @@ export type ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type ActionsRemoveCustomLabelFromSelfHostedRunnerForRepo = ( params: Params< @@ -3682,7 +4973,17 @@ export type ActionsRemoveCustomLabelFromSelfHostedRunnerForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + labels: t_runner_label[] + total_count: number + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ActionsListWorkflowRunsForRepo = ( params: Params< @@ -3691,7 +4992,15 @@ export type ActionsListWorkflowRunsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + workflow_runs: t_workflow_run[] + } + > +> export type ActionsGetWorkflowRun = ( params: Params< @@ -3700,22 +5009,26 @@ export type ActionsGetWorkflowRun = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteWorkflowRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetReviewsForRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsApproveWorkflowRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_empty_object> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActionsListWorkflowRunArtifacts = ( params: Params< @@ -3724,7 +5037,15 @@ export type ActionsListWorkflowRunArtifacts = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + artifacts: t_artifact[] + total_count: number + } + > +> export type ActionsGetWorkflowRunAttempt = ( params: Params< @@ -3733,7 +5054,7 @@ export type ActionsGetWorkflowRunAttempt = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListJobsForWorkflowRunAttempt = ( params: Params< @@ -3742,7 +5063,16 @@ export type ActionsListJobsForWorkflowRunAttempt = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + jobs: t_job[] + total_count: number + } + > + | Response<404, t_basic_error> +> export type ActionsDownloadWorkflowRunAttemptLogs = ( params: Params< @@ -3751,12 +5081,12 @@ export type ActionsDownloadWorkflowRunAttemptLogs = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCancelWorkflowRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, t_basic_error>> export type ActionsListJobsForWorkflowRun = ( params: Params< @@ -3765,22 +5095,34 @@ export type ActionsListJobsForWorkflowRun = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + jobs: t_job[] + total_count: number + } + > +> export type ActionsDownloadWorkflowRunLogs = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteWorkflowRunLogs = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<500, t_basic_error> +> export type ActionsGetPendingDeploymentsForRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsReviewPendingDeploymentsForRun = ( params: Params< @@ -3789,7 +5131,7 @@ export type ActionsReviewPendingDeploymentsForRun = ( t_ActionsReviewPendingDeploymentsForRunBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsReRunWorkflow = ( params: Params< @@ -3798,7 +5140,7 @@ export type ActionsReRunWorkflow = ( t_ActionsReRunWorkflowBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsReRunWorkflowFailedJobs = ( params: Params< @@ -3807,12 +5149,12 @@ export type ActionsReRunWorkflowFailedJobs = ( t_ActionsReRunWorkflowFailedJobsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetWorkflowRunUsage = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListRepoSecrets = ( params: Params< @@ -3821,17 +5163,25 @@ export type ActionsListRepoSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_actions_secret[] + total_count: number + } + > +> export type ActionsGetRepoPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetRepoSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateOrUpdateRepoSecret = ( params: Params< @@ -3840,12 +5190,12 @@ export type ActionsCreateOrUpdateRepoSecret = ( t_ActionsCreateOrUpdateRepoSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type ActionsDeleteRepoSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListRepoVariables = ( params: Params< @@ -3854,7 +5204,15 @@ export type ActionsListRepoVariables = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + variables: t_actions_variable[] + } + > +> export type ActionsCreateRepoVariable = ( params: Params< @@ -3863,12 +5221,12 @@ export type ActionsCreateRepoVariable = ( t_ActionsCreateRepoVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetRepoVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsUpdateRepoVariable = ( params: Params< @@ -3877,12 +5235,12 @@ export type ActionsUpdateRepoVariable = ( t_ActionsUpdateRepoVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteRepoVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListRepoWorkflows = ( params: Params< @@ -3891,17 +5249,25 @@ export type ActionsListRepoWorkflows = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + workflows: t_workflow[] + } + > +> export type ActionsGetWorkflow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDisableWorkflow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateWorkflowDispatch = ( params: Params< @@ -3910,12 +5276,12 @@ export type ActionsCreateWorkflowDispatch = ( t_ActionsCreateWorkflowDispatchBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsEnableWorkflow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListWorkflowRuns = ( params: Params< @@ -3924,12 +5290,20 @@ export type ActionsListWorkflowRuns = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + workflow_runs: t_workflow_run[] + } + > +> export type ActionsGetWorkflowUsage = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesListAssignees = ( params: Params< @@ -3938,12 +5312,12 @@ export type IssuesListAssignees = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesCheckUserCanBeAssigned = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposListAutolinks = ( params: Params< @@ -3952,7 +5326,7 @@ export type ReposListAutolinks = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateAutolink = ( params: Params< @@ -3961,27 +5335,27 @@ export type ReposCreateAutolink = ( t_ReposCreateAutolinkBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposGetAutolink = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposDeleteAutolink = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposEnableAutomatedSecurityFixes = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDisableAutomatedSecurityFixes = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListBranches = ( params: Params< @@ -3990,17 +5364,21 @@ export type ReposListBranches = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGetBranch = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_branch_with_protection> + | Response<301, t_basic_error> + | Response<404, t_basic_error> +> export type ReposGetBranchProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposUpdateBranchProtection = ( params: Params< @@ -4009,32 +5387,37 @@ export type ReposUpdateBranchProtection = ( t_ReposUpdateBranchProtectionBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_protected_branch> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ReposDeleteBranchProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type ReposGetAdminBranchProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposSetAdminBranchProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDeleteAdminBranchProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGetPullRequestReviewProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposUpdatePullRequestReviewProtection = ( params: Params< @@ -4043,7 +5426,10 @@ export type ReposUpdatePullRequestReviewProtection = ( t_ReposUpdatePullRequestReviewProtectionBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_protected_branch_pull_request_review> + | Response<422, t_validation_error> +> export type ReposDeletePullRequestReviewProtection = ( params: Params< @@ -4052,27 +5438,35 @@ export type ReposDeletePullRequestReviewProtection = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGetCommitSignatureProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_protected_branch_admin_enforced> + | Response<404, t_basic_error> +> export type ReposCreateCommitSignatureProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_protected_branch_admin_enforced> + | Response<404, t_basic_error> +> export type ReposDeleteCommitSignatureProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGetStatusChecksProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_status_check_policy> | Response<404, t_basic_error> +> export type ReposUpdateStatusCheckProtection = ( params: Params< @@ -4081,17 +5475,21 @@ export type ReposUpdateStatusCheckProtection = ( t_ReposUpdateStatusCheckProtectionBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_status_check_policy> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposRemoveStatusCheckProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetAllStatusCheckContexts = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposAddStatusCheckContexts = ( params: Params< @@ -4100,7 +5498,12 @@ export type ReposAddStatusCheckContexts = ( t_ReposAddStatusCheckContextsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, string[]> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposSetStatusCheckContexts = ( params: Params< @@ -4109,7 +5512,11 @@ export type ReposSetStatusCheckContexts = ( t_ReposSetStatusCheckContextsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, string[]> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposRemoveStatusCheckContexts = ( params: Params< @@ -4118,17 +5525,23 @@ export type ReposRemoveStatusCheckContexts = ( t_ReposRemoveStatusCheckContextsBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, string[]> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposGetAccessRestrictions = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_branch_restriction_policy> | Response<404, t_basic_error> +> export type ReposDeleteAccessRestrictions = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetAppsWithAccessToProtectedBranch = ( params: Params< @@ -4137,7 +5550,7 @@ export type ReposGetAppsWithAccessToProtectedBranch = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposAddAppAccessRestrictions = ( params: Params< @@ -4146,7 +5559,7 @@ export type ReposAddAppAccessRestrictions = ( t_ReposAddAppAccessRestrictionsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposSetAppAccessRestrictions = ( params: Params< @@ -4155,7 +5568,7 @@ export type ReposSetAppAccessRestrictions = ( t_ReposSetAppAccessRestrictionsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposRemoveAppAccessRestrictions = ( params: Params< @@ -4164,7 +5577,7 @@ export type ReposRemoveAppAccessRestrictions = ( t_ReposRemoveAppAccessRestrictionsBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposGetTeamsWithAccessToProtectedBranch = ( params: Params< @@ -4173,7 +5586,7 @@ export type ReposGetTeamsWithAccessToProtectedBranch = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposAddTeamAccessRestrictions = ( params: Params< @@ -4182,7 +5595,7 @@ export type ReposAddTeamAccessRestrictions = ( t_ReposAddTeamAccessRestrictionsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposSetTeamAccessRestrictions = ( params: Params< @@ -4191,7 +5604,7 @@ export type ReposSetTeamAccessRestrictions = ( t_ReposSetTeamAccessRestrictionsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposRemoveTeamAccessRestrictions = ( params: Params< @@ -4200,7 +5613,7 @@ export type ReposRemoveTeamAccessRestrictions = ( t_ReposRemoveTeamAccessRestrictionsBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposGetUsersWithAccessToProtectedBranch = ( params: Params< @@ -4209,7 +5622,7 @@ export type ReposGetUsersWithAccessToProtectedBranch = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposAddUserAccessRestrictions = ( params: Params< @@ -4218,7 +5631,7 @@ export type ReposAddUserAccessRestrictions = ( t_ReposAddUserAccessRestrictionsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposSetUserAccessRestrictions = ( params: Params< @@ -4227,7 +5640,7 @@ export type ReposSetUserAccessRestrictions = ( t_ReposSetUserAccessRestrictionsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposRemoveUserAccessRestrictions = ( params: Params< @@ -4236,7 +5649,7 @@ export type ReposRemoveUserAccessRestrictions = ( t_ReposRemoveUserAccessRestrictionsBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposRenameBranch = ( params: Params< @@ -4245,22 +5658,27 @@ export type ReposRenameBranch = ( t_ReposRenameBranchBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_branch_with_protection> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ChecksCreate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ChecksGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ChecksUpdate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ChecksListAnnotations = ( params: Params< @@ -4269,12 +5687,17 @@ export type ChecksListAnnotations = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ChecksRerequestRun = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_empty_object> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_basic_error> +> export type ChecksCreateSuite = ( params: Params< @@ -4283,7 +5706,7 @@ export type ChecksCreateSuite = ( t_ChecksCreateSuiteBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<201, t_check_suite>> export type ChecksSetSuitesPreferences = ( params: Params< @@ -4292,12 +5715,12 @@ export type ChecksSetSuitesPreferences = ( t_ChecksSetSuitesPreferencesBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ChecksGetSuite = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ChecksListForSuite = ( params: Params< @@ -4306,12 +5729,20 @@ export type ChecksListForSuite = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + check_runs: t_check_run[] + total_count: number + } + > +> export type ChecksRerequestSuite = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodeScanningListAlertsForRepo = ( params: Params< @@ -4320,12 +5751,38 @@ export type CodeScanningListAlertsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_alert_items[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningGetAlert = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_alert> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningUpdateAlert = ( params: Params< @@ -4334,7 +5791,19 @@ export type CodeScanningUpdateAlert = ( t_CodeScanningUpdateAlertBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_alert> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningListAlertInstances = ( params: Params< @@ -4343,7 +5812,19 @@ export type CodeScanningListAlertInstances = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_alert_instance[]> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningListRecentAnalyses = ( params: Params< @@ -4352,12 +5833,41 @@ export type CodeScanningListRecentAnalyses = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_analysis[]> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningGetAnalysis = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + [key: string]: unknown + } + > + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningDeleteAnalysis = ( params: Params< @@ -4366,17 +5876,55 @@ export type CodeScanningDeleteAnalysis = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_analysis_deletion> + | Response<400, t_scim_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningListCodeqlDatabases = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_codeql_database[]> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningGetCodeqlDatabase = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_codeql_database> + | Response<302, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningUploadSarif = ( params: Params< @@ -4385,12 +5933,38 @@ export type CodeScanningUploadSarif = ( t_CodeScanningUploadSarifBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<202, t_code_scanning_sarifs_receipt> + | Response<400, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<413, void> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodeScanningGetSarif = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_scanning_sarifs_status> + | Response<403, t_basic_error> + | Response<404, void> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type ReposCodeownersErrors = ( params: Params< @@ -4399,7 +5973,7 @@ export type ReposCodeownersErrors = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type CodespacesListInRepositoryForAuthenticatedUser = ( params: Params< @@ -4408,7 +5982,19 @@ export type CodespacesListInRepositoryForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + codespaces: t_codespace[] + total_count: number + } + > + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesCreateWithRepoForAuthenticatedUser = ( params: Params< @@ -4417,7 +6003,22 @@ export type CodespacesCreateWithRepoForAuthenticatedUser = ( t_CodespacesCreateWithRepoForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_codespace> + | Response<202, t_codespace> + | Response<400, t_scim_error> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodespacesListDevcontainersInRepositoryForAuthenticatedUser = ( params: Params< @@ -4426,7 +6027,23 @@ export type CodespacesListDevcontainersInRepositoryForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + devcontainers: { + name?: string + path: string + }[] + total_count: number + } + > + | Response<400, t_scim_error> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesRepoMachinesForAuthenticatedUser = ( params: Params< @@ -4435,7 +6052,20 @@ export type CodespacesRepoMachinesForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + machines: t_codespace_machine[] + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesPreFlightWithRepoForAuthenticatedUser = ( params: Params< @@ -4444,7 +6074,21 @@ export type CodespacesPreFlightWithRepoForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + billable_owner?: t_simple_user + defaults?: { + devcontainer_path: string | null + location: string + } + } + > + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type CodespacesListRepoSecrets = ( params: Params< @@ -4453,17 +6097,25 @@ export type CodespacesListRepoSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_repo_codespaces_secret[] + total_count: number + } + > +> export type CodespacesGetRepoPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesGetRepoSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesCreateOrUpdateRepoSecret = ( params: Params< @@ -4472,12 +6124,12 @@ export type CodespacesCreateOrUpdateRepoSecret = ( t_CodespacesCreateOrUpdateRepoSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type CodespacesDeleteRepoSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListCollaborators = ( params: Params< @@ -4486,12 +6138,12 @@ export type ReposListCollaborators = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposCheckCollaborator = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type ReposAddCollaborator = ( params: Params< @@ -4500,17 +6152,25 @@ export type ReposAddCollaborator = ( t_ReposAddCollaboratorBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_repository_invitation> + | Response<204, void> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type ReposRemoveCollaborator = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetCollaboratorPermissionLevel = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_repository_collaborator_permission> + | Response<404, t_basic_error> +> export type ReposListCommitCommentsForRepo = ( params: Params< @@ -4519,12 +6179,12 @@ export type ReposListCommitCommentsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetCommitComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposUpdateCommitComment = ( params: Params< @@ -4533,12 +6193,12 @@ export type ReposUpdateCommitComment = ( t_ReposUpdateCommitCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposDeleteCommitComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReactionsListForCommitComment = ( params: Params< @@ -4547,7 +6207,7 @@ export type ReactionsListForCommitComment = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReactionsCreateForCommitComment = ( params: Params< @@ -4556,12 +6216,16 @@ export type ReactionsCreateForCommitComment = ( t_ReactionsCreateForCommitCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_reaction> + | Response<201, t_reaction> + | Response<422, t_validation_error> +> export type ReactionsDeleteForCommitComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListCommits = ( params: Params< @@ -4570,12 +6234,20 @@ export type ReposListCommits = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_commit[]> + | Response<400, t_scim_error> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<500, t_basic_error> +> export type ReposListBranchesForHeadCommit = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_branch_short[]> | Response<422, t_validation_error> +> export type ReposListCommentsForCommit = ( params: Params< @@ -4584,7 +6256,7 @@ export type ReposListCommentsForCommit = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateCommitComment = ( params: Params< @@ -4593,7 +6265,11 @@ export type ReposCreateCommitComment = ( t_ReposCreateCommitCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_commit_comment> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type ReposListPullRequestsAssociatedWithCommit = ( params: Params< @@ -4602,7 +6278,7 @@ export type ReposListPullRequestsAssociatedWithCommit = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetCommit = ( params: Params< @@ -4611,7 +6287,20 @@ export type ReposGetCommit = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_commit> + | Response<404, t_basic_error> + | Response<422, t_validation_error> + | Response<500, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type ChecksListForRef = ( params: Params< @@ -4620,7 +6309,15 @@ export type ChecksListForRef = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + check_runs: t_check_run[] + total_count: number + } + > +> export type ChecksListSuitesForRef = ( params: Params< @@ -4629,7 +6326,15 @@ export type ChecksListSuitesForRef = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + check_suites: t_check_suite[] + total_count: number + } + > +> export type ReposGetCombinedStatusForRef = ( params: Params< @@ -4638,7 +6343,9 @@ export type ReposGetCombinedStatusForRef = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_combined_commit_status> | Response<404, t_basic_error> +> export type ReposListCommitStatusesForRef = ( params: Params< @@ -4647,12 +6354,12 @@ export type ReposListCommitStatusesForRef = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<301, t_basic_error>> export type ReposGetCommunityProfileMetrics = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCompareCommits = ( params: Params< @@ -4661,7 +6368,19 @@ export type ReposCompareCommits = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_commit_comparison> + | Response<404, t_basic_error> + | Response<500, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type ReposGetContent = ( params: Params< @@ -4670,7 +6389,18 @@ export type ReposGetContent = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + | t_content_directory + | t_content_file + | t_content_symlink + | t_content_submodule + > + | Response<302, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposCreateOrUpdateFileContents = ( params: Params< @@ -4679,7 +6409,13 @@ export type ReposCreateOrUpdateFileContents = ( t_ReposCreateOrUpdateFileContentsBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_file_commit> + | Response<201, t_file_commit> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<422, t_validation_error> +> export type ReposDeleteFile = ( params: Params< @@ -4688,7 +6424,20 @@ export type ReposDeleteFile = ( t_ReposDeleteFileBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_file_commit> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type ReposListContributors = ( params: Params< @@ -4697,7 +6446,12 @@ export type ReposListContributors = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_contributor[]> + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type DependabotListAlertsForRepo = ( params: Params< @@ -4706,12 +6460,24 @@ export type DependabotListAlertsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_dependabot_alert[]> + | Response<304, void> + | Response<400, t_scim_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type DependabotGetAlert = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_dependabot_alert> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type DependabotUpdateAlert = ( params: Params< @@ -4720,7 +6486,14 @@ export type DependabotUpdateAlert = ( t_DependabotUpdateAlertBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_dependabot_alert> + | Response<400, t_scim_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<422, t_validation_error_simple> +> export type DependabotListRepoSecrets = ( params: Params< @@ -4729,17 +6502,25 @@ export type DependabotListRepoSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_dependabot_secret[] + total_count: number + } + > +> export type DependabotGetRepoPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependabotGetRepoSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependabotCreateOrUpdateRepoSecret = ( params: Params< @@ -4748,12 +6529,12 @@ export type DependabotCreateOrUpdateRepoSecret = ( t_DependabotCreateOrUpdateRepoSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type DependabotDeleteRepoSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type DependencyGraphDiffRange = ( params: Params< @@ -4762,7 +6543,11 @@ export type DependencyGraphDiffRange = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_dependency_graph_diff> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type DependencyGraphCreateRepositorySnapshot = ( params: Params< @@ -4771,7 +6556,17 @@ export type DependencyGraphCreateRepositorySnapshot = ( t_DependencyGraphCreateRepositorySnapshotBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 201, + { + created_at: string + id: number + message: string + result: string + } + > +> export type ReposListDeployments = ( params: Params< @@ -4780,7 +6575,7 @@ export type ReposListDeployments = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateDeployment = ( params: Params< @@ -4789,17 +6584,31 @@ export type ReposCreateDeployment = ( t_ReposCreateDeploymentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_deployment> + | Response< + 202, + { + message?: string + } + > + | Response<409, void> + | Response<422, t_validation_error> +> export type ReposGetDeployment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposDeleteDeployment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ReposListDeploymentStatuses = ( params: Params< @@ -4808,7 +6617,9 @@ export type ReposListDeploymentStatuses = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_deployment_status[]> | Response<404, t_basic_error> +> export type ReposCreateDeploymentStatus = ( params: Params< @@ -4817,12 +6628,14 @@ export type ReposCreateDeploymentStatus = ( t_ReposCreateDeploymentStatusBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<201, t_deployment_status> | Response<422, t_validation_error> +> export type ReposGetDeploymentStatus = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposCreateDispatchEvent = ( params: Params< @@ -4831,7 +6644,7 @@ export type ReposCreateDispatchEvent = ( t_ReposCreateDispatchEventBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposGetAllEnvironments = ( params: Params< @@ -4840,12 +6653,20 @@ export type ReposGetAllEnvironments = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + environments?: t_environment[] + total_count?: number + } + > +> export type ReposGetEnvironment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateOrUpdateEnvironment = ( params: Params< @@ -4854,12 +6675,12 @@ export type ReposCreateOrUpdateEnvironment = ( t_ReposCreateOrUpdateEnvironmentBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_basic_error>> export type ReposDeleteAnEnvironment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListDeploymentBranchPolicies = ( params: Params< @@ -4868,7 +6689,15 @@ export type ReposListDeploymentBranchPolicies = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + branch_policies: t_deployment_branch_policy[] + total_count: number + } + > +> export type ReposCreateDeploymentBranchPolicy = ( params: Params< @@ -4877,12 +6706,16 @@ export type ReposCreateDeploymentBranchPolicy = ( t_ReposCreateDeploymentBranchPolicyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_deployment_branch_policy> + | Response<303, void> + | Response<404, void> +> export type ReposGetDeploymentBranchPolicy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposUpdateDeploymentBranchPolicy = ( params: Params< @@ -4891,12 +6724,12 @@ export type ReposUpdateDeploymentBranchPolicy = ( t_ReposUpdateDeploymentBranchPolicyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDeleteDeploymentBranchPolicy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListRepoEvents = ( params: Params< @@ -4905,7 +6738,7 @@ export type ActivityListRepoEvents = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListForks = ( params: Params< @@ -4914,7 +6747,9 @@ export type ReposListForks = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_minimal_repository[]> | Response<400, t_scim_error> +> export type ReposCreateFork = ( params: Params< @@ -4923,17 +6758,34 @@ export type ReposCreateFork = ( t_ReposCreateForkBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<202, t_full_repository> + | Response<400, t_scim_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GitCreateBlob = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_short_blob> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<422, t_validation_error> +> export type GitGetBlob = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_blob> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GitCreateCommit = ( params: Params< @@ -4942,57 +6794,70 @@ export type GitCreateCommit = ( t_GitCreateCommitBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_git_commit> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GitGetCommit = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type GitListMatchingRefs = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type GitGetRef = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type GitCreateRef = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type GitUpdateRef = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type GitDeleteRef = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type GitCreateTag = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type GitGetTag = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type GitCreateTree = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_git_tree> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type GitGetTree = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_git_tree> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposListWebhooks = ( params: Params< @@ -5001,7 +6866,7 @@ export type ReposListWebhooks = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposCreateWebhook = ( params: Params< @@ -5010,12 +6875,17 @@ export type ReposCreateWebhook = ( t_ReposCreateWebhookBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_hook> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposGetWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposUpdateWebhook = ( params: Params< @@ -5024,17 +6894,21 @@ export type ReposUpdateWebhook = ( t_ReposUpdateWebhookBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposDeleteWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGetWebhookConfigForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposUpdateWebhookConfigForRepo = ( params: Params< @@ -5043,7 +6917,7 @@ export type ReposUpdateWebhookConfigForRepo = ( t_ReposUpdateWebhookConfigForRepoBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListWebhookDeliveries = ( params: Params< @@ -5052,32 +6926,53 @@ export type ReposListWebhookDeliveries = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook_delivery_item[]> + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type ReposGetWebhookDelivery = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hook_delivery> + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type ReposRedeliverWebhookDelivery = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<400, t_scim_error> + | Response<422, t_validation_error> +> export type ReposPingWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposTestPushWebhook = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type MigrationsGetImportStatus = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_import> + | Response<404, t_basic_error> + | Response<503, t_basic_error> +> export type MigrationsStartImport = ( params: Params< @@ -5086,7 +6981,12 @@ export type MigrationsStartImport = ( t_MigrationsStartImportBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_import> + | Response<404, t_basic_error> + | Response<422, t_validation_error> + | Response<503, t_basic_error> +> export type MigrationsUpdateImport = ( params: Params< @@ -5095,12 +6995,12 @@ export type MigrationsUpdateImport = ( t_MigrationsUpdateImportBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<503, t_basic_error>> export type MigrationsCancelImport = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<503, t_basic_error>> export type MigrationsGetCommitAuthors = ( params: Params< @@ -5109,7 +7009,11 @@ export type MigrationsGetCommitAuthors = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_porter_author[]> + | Response<404, t_basic_error> + | Response<503, t_basic_error> +> export type MigrationsMapCommitAuthor = ( params: Params< @@ -5118,12 +7022,19 @@ export type MigrationsMapCommitAuthor = ( t_MigrationsMapCommitAuthorBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_porter_author> + | Response<404, t_basic_error> + | Response<422, t_validation_error> + | Response<503, t_basic_error> +> export type MigrationsGetLargeFiles = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_porter_large_file[]> | Response<503, t_basic_error> +> export type MigrationsSetLfsPreference = ( params: Params< @@ -5132,17 +7043,32 @@ export type MigrationsSetLfsPreference = ( t_MigrationsSetLfsPreferenceBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_import> + | Response<422, t_validation_error> + | Response<503, t_basic_error> +> export type AppsGetRepoInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_installation> + | Response<301, t_basic_error> + | Response<404, t_basic_error> +> export type InteractionsGetRestrictionsForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + [key: string]: unknown + } + > +> export type InteractionsSetRestrictionsForRepo = ( params: Params< @@ -5151,7 +7077,7 @@ export type InteractionsSetRestrictionsForRepo = ( t_InteractionsSetRestrictionsForRepoBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type InteractionsRemoveRestrictionsForRepo = ( params: Params< @@ -5160,7 +7086,7 @@ export type InteractionsRemoveRestrictionsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<409, void>> export type ReposListInvitations = ( params: Params< @@ -5169,7 +7095,7 @@ export type ReposListInvitations = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposUpdateInvitation = ( params: Params< @@ -5178,12 +7104,12 @@ export type ReposUpdateInvitation = ( t_ReposUpdateInvitationBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDeleteInvitation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesListForRepo = ( params: Params< @@ -5192,12 +7118,31 @@ export type IssuesListForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue[]> + | Response<301, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesCreate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_issue> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type IssuesListCommentsForRepo = ( params: Params< @@ -5206,12 +7151,16 @@ export type IssuesListCommentsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue_comment[]> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesGetComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesUpdateComment = ( params: Params< @@ -5220,12 +7169,12 @@ export type IssuesUpdateComment = ( t_IssuesUpdateCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type IssuesDeleteComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsListForIssueComment = ( params: Params< @@ -5234,7 +7183,7 @@ export type ReactionsListForIssueComment = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReactionsCreateForIssueComment = ( params: Params< @@ -5243,12 +7192,16 @@ export type ReactionsCreateForIssueComment = ( t_ReactionsCreateForIssueCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_reaction> + | Response<201, t_reaction> + | Response<422, t_validation_error> +> export type ReactionsDeleteForIssueComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesListEventsForRepo = ( params: Params< @@ -5257,17 +7210,28 @@ export type IssuesListEventsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type IssuesGetEvent = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue_event> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type IssuesGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue> + | Response<301, t_basic_error> + | Response<304, void> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type IssuesUpdate = ( params: Params< @@ -5276,7 +7240,22 @@ export type IssuesUpdate = ( t_IssuesUpdateBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue> + | Response<301, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type IssuesAddAssignees = ( params: Params< @@ -5285,7 +7264,7 @@ export type IssuesAddAssignees = ( t_IssuesAddAssigneesBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesRemoveAssignees = ( params: Params< @@ -5294,12 +7273,12 @@ export type IssuesRemoveAssignees = ( t_IssuesRemoveAssigneesBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesCheckUserCanBeAssignedToIssue = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesListComments = ( params: Params< @@ -5308,7 +7287,11 @@ export type IssuesListComments = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_issue_comment[]> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type IssuesCreateComment = ( params: Params< @@ -5317,7 +7300,13 @@ export type IssuesCreateComment = ( t_IssuesCreateCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_issue_comment> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesListEvents = ( params: Params< @@ -5326,7 +7315,9 @@ export type IssuesListEvents = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_issue_event_for_issue[]> | Response<410, t_basic_error> +> export type IssuesListLabelsOnIssue = ( params: Params< @@ -5335,7 +7326,12 @@ export type IssuesListLabelsOnIssue = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_label[]> + | Response<301, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type IssuesAddLabels = ( params: Params< @@ -5344,7 +7340,13 @@ export type IssuesAddLabels = ( t_IssuesAddLabelsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_label[]> + | Response<301, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesSetLabels = ( params: Params< @@ -5353,17 +7355,33 @@ export type IssuesSetLabels = ( t_IssuesSetLabelsBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_label[]> + | Response<301, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesRemoveAllLabels = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<301, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type IssuesRemoveLabel = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_label[]> + | Response<301, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type IssuesLock = ( params: Params< @@ -5372,12 +7390,22 @@ export type IssuesLock = ( t_IssuesLockBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesUnlock = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReactionsListForIssue = ( params: Params< @@ -5386,7 +7414,11 @@ export type ReactionsListForIssue = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_reaction[]> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type ReactionsCreateForIssue = ( params: Params< @@ -5395,12 +7427,16 @@ export type ReactionsCreateForIssue = ( t_ReactionsCreateForIssueBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_reaction> + | Response<201, t_reaction> + | Response<422, t_validation_error> +> export type ReactionsDeleteForIssue = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesListEventsForTimeline = ( params: Params< @@ -5409,7 +7445,11 @@ export type IssuesListEventsForTimeline = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_timeline_issue_events[]> + | Response<404, t_basic_error> + | Response<410, t_basic_error> +> export type ReposListDeployKeys = ( params: Params< @@ -5418,7 +7458,7 @@ export type ReposListDeployKeys = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateDeployKey = ( params: Params< @@ -5427,17 +7467,17 @@ export type ReposCreateDeployKey = ( t_ReposCreateDeployKeyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ReposGetDeployKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposDeleteDeployKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesListLabelsForRepo = ( params: Params< @@ -5446,7 +7486,7 @@ export type IssuesListLabelsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesCreateLabel = ( params: Params< @@ -5455,12 +7495,16 @@ export type IssuesCreateLabel = ( t_IssuesCreateLabelBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_label> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesGetLabel = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesUpdateLabel = ( params: Params< @@ -5469,32 +7513,40 @@ export type IssuesUpdateLabel = ( t_IssuesUpdateLabelBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesDeleteLabel = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListLanguages = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposEnableLfsForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<403, void> +> export type ReposDisableLfsForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type LicensesGetForRepo = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposMergeUpstream = ( params: Params< @@ -5503,12 +7555,21 @@ export type ReposMergeUpstream = ( t_ReposMergeUpstreamBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_merged_upstream> | Response<409, void> | Response<422, void> +> export type ReposMerge = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_commit> + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, void> + | Response<409, void> + | Response<422, t_validation_error> +> export type IssuesListMilestones = ( params: Params< @@ -5517,7 +7578,7 @@ export type IssuesListMilestones = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesCreateMilestone = ( params: Params< @@ -5526,12 +7587,16 @@ export type IssuesCreateMilestone = ( t_IssuesCreateMilestoneBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_milestone> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type IssuesGetMilestone = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesUpdateMilestone = ( params: Params< @@ -5540,12 +7605,12 @@ export type IssuesUpdateMilestone = ( t_IssuesUpdateMilestoneBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesDeleteMilestone = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type IssuesListLabelsForMilestone = ( params: Params< @@ -5554,7 +7619,7 @@ export type IssuesListLabelsForMilestone = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListRepoNotificationsForAuthenticatedUser = ( params: Params< @@ -5563,7 +7628,7 @@ export type ActivityListRepoNotificationsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityMarkRepoNotificationsAsRead = ( params: Params< @@ -5572,12 +7637,21 @@ export type ActivityMarkRepoNotificationsAsRead = ( t_ActivityMarkRepoNotificationsAsReadBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + message?: string + url?: string + } + > + | Response<205, void> +> export type ReposGetPages = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposCreatePagesSite = ( params: Params< @@ -5586,7 +7660,11 @@ export type ReposCreatePagesSite = ( t_ReposCreatePagesSiteBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_page> + | Response<409, t_basic_error> + | Response<422, t_validation_error> +> export type ReposUpdateInformationAboutPagesSite = ( params: Params< @@ -5595,12 +7673,22 @@ export type ReposUpdateInformationAboutPagesSite = ( t_ReposUpdateInformationAboutPagesSiteBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<400, t_scim_error> + | Response<409, t_basic_error> + | Response<422, t_validation_error> +> export type ReposDeletePagesSite = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<422, t_validation_error> +> export type ReposListPagesBuilds = ( params: Params< @@ -5609,22 +7697,22 @@ export type ReposListPagesBuilds = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposRequestPagesBuild = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetLatestPagesBuild = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetPagesBuild = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreatePagesDeployment = ( params: Params< @@ -5633,12 +7721,23 @@ export type ReposCreatePagesDeployment = ( t_ReposCreatePagesDeploymentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_page_deployment> + | Response<400, t_scim_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposGetPagesHealthCheck = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pages_health_check> + | Response<202, t_empty_object> + | Response<400, void> + | Response<404, t_basic_error> + | Response<422, void> +> export type ProjectsListForRepo = ( params: Params< @@ -5647,7 +7746,14 @@ export type ProjectsListForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_project[]> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ProjectsCreateForRepo = ( params: Params< @@ -5656,17 +7762,32 @@ export type ProjectsCreateForRepo = ( t_ProjectsCreateForRepoBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_project> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<410, t_basic_error> + | Response<422, t_validation_error_simple> +> export type PullsList = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_simple[]> + | Response<304, void> + | Response<422, t_validation_error> +> export type PullsCreate = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_pull_request> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type PullsListReviewCommentsForRepo = ( params: Params< @@ -5675,12 +7796,14 @@ export type PullsListReviewCommentsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsGetReviewComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_pull_request_review_comment> | Response<404, t_basic_error> +> export type PullsUpdateReviewComment = ( params: Params< @@ -5689,12 +7812,12 @@ export type PullsUpdateReviewComment = ( t_PullsUpdateReviewCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsDeleteReviewComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReactionsListForPullRequestReviewComment = ( params: Params< @@ -5703,7 +7826,7 @@ export type ReactionsListForPullRequestReviewComment = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReactionsCreateForPullRequestReviewComment = ( params: Params< @@ -5712,17 +7835,34 @@ export type ReactionsCreateForPullRequestReviewComment = ( t_ReactionsCreateForPullRequestReviewCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_reaction> + | Response<201, t_reaction> + | Response<422, t_validation_error> +> export type ReactionsDeleteForPullRequestComment = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsGet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request> + | Response<304, void> + | Response<404, t_basic_error> + | Response<500, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type PullsUpdate = ( params: Params< @@ -5731,7 +7871,11 @@ export type PullsUpdate = ( t_PullsUpdateBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type CodespacesCreateWithPrForAuthenticatedUser = ( params: Params< @@ -5740,7 +7884,21 @@ export type CodespacesCreateWithPrForAuthenticatedUser = ( t_CodespacesCreateWithPrForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_codespace> + | Response<202, t_codespace> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type PullsListReviewComments = ( params: Params< @@ -5749,7 +7907,7 @@ export type PullsListReviewComments = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsCreateReviewComment = ( params: Params< @@ -5758,7 +7916,11 @@ export type PullsCreateReviewComment = ( t_PullsCreateReviewCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_pull_request_review_comment> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type PullsCreateReplyForReviewComment = ( params: Params< @@ -5767,7 +7929,9 @@ export type PullsCreateReplyForReviewComment = ( t_PullsCreateReplyForReviewCommentBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<201, t_pull_request_review_comment> | Response<404, t_basic_error> +> export type PullsListCommits = ( params: Params< @@ -5776,7 +7940,7 @@ export type PullsListCommits = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsListFiles = ( params: Params< @@ -5785,12 +7949,24 @@ export type PullsListFiles = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_diff_entry[]> + | Response<422, t_validation_error> + | Response<500, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type PullsCheckIfMerged = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type PullsMerge = ( params: Params< @@ -5799,12 +7975,31 @@ export type PullsMerge = ( t_PullsMergeBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_merge_result> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 405, + { + documentation_url?: string + message?: string + } + > + | Response< + 409, + { + documentation_url?: string + message?: string + } + > + | Response<422, t_validation_error> +> export type PullsListRequestedReviewers = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsRequestReviewers = ( params: Params< @@ -5813,7 +8008,11 @@ export type PullsRequestReviewers = ( t_PullsRequestReviewersBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_pull_request_simple> + | Response<403, t_basic_error> + | Response<422, void> +> export type PullsRemoveRequestedReviewers = ( params: Params< @@ -5822,7 +8021,9 @@ export type PullsRemoveRequestedReviewers = ( t_PullsRemoveRequestedReviewersBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_pull_request_simple> | Response<422, t_validation_error> +> export type PullsListReviews = ( params: Params< @@ -5831,7 +8032,7 @@ export type PullsListReviews = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PullsCreateReview = ( params: Params< @@ -5840,12 +8041,18 @@ export type PullsCreateReview = ( t_PullsCreateReviewBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_review> + | Response<403, t_basic_error> + | Response<422, t_validation_error_simple> +> export type PullsGetReview = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_pull_request_review> | Response<404, t_basic_error> +> export type PullsUpdateReview = ( params: Params< @@ -5854,12 +8061,19 @@ export type PullsUpdateReview = ( t_PullsUpdateReviewBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_review> + | Response<422, t_validation_error_simple> +> export type PullsDeletePendingReview = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_review> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type PullsListCommentsForReview = ( params: Params< @@ -5868,7 +8082,7 @@ export type PullsListCommentsForReview = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type PullsDismissReview = ( params: Params< @@ -5877,7 +8091,11 @@ export type PullsDismissReview = ( t_PullsDismissReviewBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_review> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type PullsSubmitReview = ( params: Params< @@ -5886,7 +8104,12 @@ export type PullsSubmitReview = ( t_PullsSubmitReviewBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_pull_request_review> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type PullsUpdateBranch = ( params: Params< @@ -5895,7 +8118,17 @@ export type PullsUpdateBranch = ( t_PullsUpdateBranchBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + message?: string + url?: string + } + > + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type ReposGetReadme = ( params: Params< @@ -5904,7 +8137,11 @@ export type ReposGetReadme = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_content_file> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposGetReadmeInDirectory = ( params: Params< @@ -5913,7 +8150,11 @@ export type ReposGetReadmeInDirectory = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_content_file> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposListReleases = ( params: Params< @@ -5922,7 +8163,7 @@ export type ReposListReleases = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposCreateRelease = ( params: Params< @@ -5931,12 +8172,20 @@ export type ReposCreateRelease = ( t_ReposCreateReleaseBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_release> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposGetReleaseAsset = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_release_asset> + | Response<302, void> + | Response<404, t_basic_error> +> export type ReposUpdateReleaseAsset = ( params: Params< @@ -5945,12 +8194,12 @@ export type ReposUpdateReleaseAsset = ( t_ReposUpdateReleaseAssetBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDeleteReleaseAsset = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGenerateReleaseNotes = ( params: Params< @@ -5959,22 +8208,24 @@ export type ReposGenerateReleaseNotes = ( t_ReposGenerateReleaseNotesBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_release_notes_content> | Response<404, t_basic_error> +> export type ReposGetLatestRelease = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetReleaseByTag = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposGetRelease = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposUpdateRelease = ( params: Params< @@ -5983,12 +8234,12 @@ export type ReposUpdateRelease = ( t_ReposUpdateReleaseBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposDeleteRelease = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListReleaseAssets = ( params: Params< @@ -5997,7 +8248,7 @@ export type ReposListReleaseAssets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposUploadReleaseAsset = ( params: Params< @@ -6006,7 +8257,7 @@ export type ReposUploadReleaseAsset = ( t_ReposUploadReleaseAssetBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, void>> export type ReactionsListForRelease = ( params: Params< @@ -6015,7 +8266,7 @@ export type ReactionsListForRelease = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReactionsCreateForRelease = ( params: Params< @@ -6024,12 +8275,16 @@ export type ReactionsCreateForRelease = ( t_ReactionsCreateForReleaseBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_reaction> + | Response<201, t_reaction> + | Response<422, t_validation_error> +> export type ReactionsDeleteForRelease = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type SecretScanningListAlertsForRepo = ( params: Params< @@ -6038,12 +8293,35 @@ export type SecretScanningListAlertsForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_secret_scanning_alert[]> + | Response<404, void> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SecretScanningGetAlert = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_secret_scanning_alert> + | Response<304, void> + | Response<404, void> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SecretScanningUpdateAlert = ( params: Params< @@ -6052,7 +8330,20 @@ export type SecretScanningUpdateAlert = ( t_SecretScanningUpdateAlertBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_secret_scanning_alert> + | Response<400, void> + | Response<404, void> + | Response<422, void> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SecretScanningListLocationsForAlert = ( params: Params< @@ -6061,7 +8352,18 @@ export type SecretScanningListLocationsForAlert = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_secret_scanning_location[]> + | Response<404, void> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type ActivityListStargazersForRepo = ( params: Params< @@ -6070,32 +8372,69 @@ export type ActivityListStargazersForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + [key: string]: unknown + } + > + | Response<422, t_validation_error> +> export type ReposGetCodeFrequencyStats = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_code_frequency_stat[]> + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<204, void> +> export type ReposGetCommitActivityStats = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_commit_activity[]> + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<204, void> +> export type ReposGetContributorsStats = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_contributor_activity[]> + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<204, void> +> export type ReposGetParticipationStats = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_participation_stats> | Response<404, t_basic_error> +> export type ReposGetPunchCardStats = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type ReposCreateCommitStatus = ( params: Params< @@ -6104,7 +8443,7 @@ export type ReposCreateCommitStatus = ( t_ReposCreateCommitStatusBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListWatchersForRepo = ( params: Params< @@ -6113,12 +8452,16 @@ export type ActivityListWatchersForRepo = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityGetRepoSubscription = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_repository_subscription> + | Response<403, t_basic_error> + | Response<404, void> +> export type ActivitySetRepoSubscription = ( params: Params< @@ -6127,22 +8470,26 @@ export type ActivitySetRepoSubscription = ( t_ActivitySetRepoSubscriptionBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityDeleteRepoSubscription = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListTags = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListTagProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_tag_protection[]> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposCreateTagProtection = ( params: Params< @@ -6151,17 +8498,25 @@ export type ReposCreateTagProtection = ( t_ReposCreateTagProtectionBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_tag_protection> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposDeleteTagProtection = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposDownloadTarballArchive = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListTeams = ( params: Params< @@ -6170,7 +8525,7 @@ export type ReposListTeams = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposGetAllTopics = ( params: Params< @@ -6179,7 +8534,7 @@ export type ReposGetAllTopics = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type ReposReplaceAllTopics = ( params: Params< @@ -6188,7 +8543,11 @@ export type ReposReplaceAllTopics = ( t_ReposReplaceAllTopicsBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_topic> + | Response<404, t_basic_error> + | Response<422, t_validation_error_simple> +> export type ReposGetClones = ( params: Params< @@ -6197,47 +8556,47 @@ export type ReposGetClones = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type ReposGetTopPaths = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type ReposGetTopReferrers = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type ReposGetViews = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, t_basic_error>> export type ReposTransfer = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCheckVulnerabilityAlerts = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type ReposEnableVulnerabilityAlerts = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDisableVulnerabilityAlerts = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposDownloadZipballArchive = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposCreateUsingTemplate = ( params: Params< @@ -6246,12 +8605,16 @@ export type ReposCreateUsingTemplate = ( t_ReposCreateUsingTemplateBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListPublic = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_minimal_repository[]> + | Response<304, void> + | Response<422, t_validation_error> +> export type ActionsListEnvironmentSecrets = ( params: Params< @@ -6260,17 +8623,25 @@ export type ActionsListEnvironmentSecrets = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_actions_secret[] + total_count: number + } + > +> export type ActionsGetEnvironmentPublicKey = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetEnvironmentSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsCreateOrUpdateEnvironmentSecret = ( params: Params< @@ -6279,12 +8650,12 @@ export type ActionsCreateOrUpdateEnvironmentSecret = ( t_ActionsCreateOrUpdateEnvironmentSecretBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<204, void>> export type ActionsDeleteEnvironmentSecret = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsListEnvironmentVariables = ( params: Params< @@ -6293,7 +8664,15 @@ export type ActionsListEnvironmentVariables = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + total_count: number + variables: t_actions_variable[] + } + > +> export type ActionsCreateEnvironmentVariable = ( params: Params< @@ -6302,12 +8681,12 @@ export type ActionsCreateEnvironmentVariable = ( t_ActionsCreateEnvironmentVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsGetEnvironmentVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsUpdateEnvironmentVariable = ( params: Params< @@ -6316,52 +8695,163 @@ export type ActionsUpdateEnvironmentVariable = ( t_ActionsUpdateEnvironmentVariableBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActionsDeleteEnvironmentVariable = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type SearchCode = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_code_search_result_item[] + total_count: number + } + > + | Response<304, void> + | Response<403, t_basic_error> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SearchCommits = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_commit_search_result_item[] + total_count: number + } + > + | Response<304, void> +> export type SearchIssuesAndPullRequests = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_issue_search_result_item[] + total_count: number + } + > + | Response<304, void> + | Response<403, t_basic_error> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SearchLabels = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_label_search_result_item[] + total_count: number + } + > + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type SearchRepos = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_repo_search_result_item[] + total_count: number + } + > + | Response<304, void> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type SearchTopics = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_topic_search_result_item[] + total_count: number + } + > + | Response<304, void> +> export type SearchUsers = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + incomplete_results: boolean + items: t_user_search_result_item[] + total_count: number + } + > + | Response<304, void> + | Response<422, t_validation_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type TeamsGetLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type TeamsUpdateLegacy = ( params: Params< @@ -6370,12 +8860,22 @@ export type TeamsUpdateLegacy = ( t_TeamsUpdateLegacyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_team_full> + | Response<201, t_team_full> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsDeleteLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsListDiscussionsLegacy = ( params: Params< @@ -6384,7 +8884,7 @@ export type TeamsListDiscussionsLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsCreateDiscussionLegacy = ( params: Params< @@ -6393,12 +8893,12 @@ export type TeamsCreateDiscussionLegacy = ( t_TeamsCreateDiscussionLegacyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsGetDiscussionLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsUpdateDiscussionLegacy = ( params: Params< @@ -6407,12 +8907,12 @@ export type TeamsUpdateDiscussionLegacy = ( t_TeamsUpdateDiscussionLegacyBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsDeleteDiscussionLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListDiscussionCommentsLegacy = ( params: Params< @@ -6421,7 +8921,7 @@ export type TeamsListDiscussionCommentsLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsCreateDiscussionCommentLegacy = ( params: Params< @@ -6430,12 +8930,12 @@ export type TeamsCreateDiscussionCommentLegacy = ( t_TeamsCreateDiscussionCommentLegacyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsGetDiscussionCommentLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsUpdateDiscussionCommentLegacy = ( params: Params< @@ -6444,12 +8944,12 @@ export type TeamsUpdateDiscussionCommentLegacy = ( t_TeamsUpdateDiscussionCommentLegacyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsDeleteDiscussionCommentLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsListForTeamDiscussionCommentLegacy = ( params: Params< @@ -6458,7 +8958,7 @@ export type ReactionsListForTeamDiscussionCommentLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsCreateForTeamDiscussionCommentLegacy = ( params: Params< @@ -6467,7 +8967,7 @@ export type ReactionsCreateForTeamDiscussionCommentLegacy = ( t_ReactionsCreateForTeamDiscussionCommentLegacyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsListForTeamDiscussionLegacy = ( params: Params< @@ -6476,7 +8976,7 @@ export type ReactionsListForTeamDiscussionLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReactionsCreateForTeamDiscussionLegacy = ( params: Params< @@ -6485,7 +8985,7 @@ export type ReactionsCreateForTeamDiscussionLegacy = ( t_ReactionsCreateForTeamDiscussionLegacyBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListPendingInvitationsLegacy = ( params: Params< @@ -6494,7 +8994,7 @@ export type TeamsListPendingInvitationsLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListMembersLegacy = ( params: Params< @@ -6503,27 +9003,32 @@ export type TeamsListMembersLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type TeamsGetMemberLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type TeamsAddMemberLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<404, void> + | Response<422, void> +> export type TeamsRemoveMemberLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type TeamsGetMembershipForUserLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type TeamsAddOrUpdateMembershipForUserLegacy = ( params: Params< @@ -6532,12 +9037,17 @@ export type TeamsAddOrUpdateMembershipForUserLegacy = ( t_TeamsAddOrUpdateMembershipForUserLegacyBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_team_membership> + | Response<403, void> + | Response<404, t_basic_error> + | Response<422, void> +> export type TeamsRemoveMembershipForUserLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<403, void>> export type TeamsListProjectsLegacy = ( params: Params< @@ -6546,7 +9056,7 @@ export type TeamsListProjectsLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type TeamsCheckPermissionsForProjectLegacy = ( params: Params< @@ -6555,7 +9065,7 @@ export type TeamsCheckPermissionsForProjectLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type TeamsAddOrUpdateProjectPermissionsLegacy = ( params: Params< @@ -6564,12 +9074,27 @@ export type TeamsAddOrUpdateProjectPermissionsLegacy = ( t_TeamsAddOrUpdateProjectPermissionsLegacyBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response< + 403, + { + documentation_url?: string + message?: string + } + > + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsRemoveProjectLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsListReposLegacy = ( params: Params< @@ -6578,12 +9103,16 @@ export type TeamsListReposLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_minimal_repository[]> | Response<404, t_basic_error> +> export type TeamsCheckPermissionsForRepoLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_team_repository> | Response<204, void> | Response<404, void> +> export type TeamsAddOrUpdateRepoPermissionsLegacy = ( params: Params< @@ -6592,12 +9121,16 @@ export type TeamsAddOrUpdateRepoPermissionsLegacy = ( t_TeamsAddOrUpdateRepoPermissionsLegacyBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type TeamsRemoveRepoLegacy = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type TeamsListChildLegacy = ( params: Params< @@ -6606,47 +9139,116 @@ export type TeamsListChildLegacy = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_team[]> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersGetAuthenticated = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_private_user | t_public_user> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type UsersUpdateAuthenticated = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_private_user> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersListBlockedByAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_simple_user[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersCheckBlocked = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersBlock = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersUnblock = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type CodespacesListForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + codespaces: t_codespace[] + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesCreateForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_codespace> + | Response<202, t_codespace> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response< + 503, + { + code?: string + documentation_url?: string + message?: string + } + > +> export type CodespacesListSecretsForAuthenticatedUser = ( params: Params< @@ -6655,12 +9257,20 @@ export type CodespacesListSecretsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + secrets: t_codespaces_secret[] + total_count: number + } + > +> export type CodespacesGetPublicKeyForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesGetSecretForAuthenticatedUser = ( params: Params< @@ -6669,7 +9279,7 @@ export type CodespacesGetSecretForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesCreateOrUpdateSecretForAuthenticatedUser = ( params: Params< @@ -6678,7 +9288,12 @@ export type CodespacesCreateOrUpdateSecretForAuthenticatedUser = ( t_CodespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_empty_object> + | Response<204, void> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type CodespacesDeleteSecretForAuthenticatedUser = ( params: Params< @@ -6687,7 +9302,7 @@ export type CodespacesDeleteSecretForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type CodespacesListRepositoriesForSecretForAuthenticatedUser = ( params: Params< @@ -6696,7 +9311,19 @@ export type CodespacesListRepositoriesForSecretForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + repositories: t_minimal_repository[] + total_count: number + } + > + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesSetRepositoriesForSecretForAuthenticatedUser = ( params: Params< @@ -6705,7 +9332,13 @@ export type CodespacesSetRepositoriesForSecretForAuthenticatedUser = ( t_CodespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesAddRepositoryForSecretForAuthenticatedUser = ( params: Params< @@ -6714,7 +9347,13 @@ export type CodespacesAddRepositoryForSecretForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesRemoveRepositoryForSecretForAuthenticatedUser = ( params: Params< @@ -6723,12 +9362,25 @@ export type CodespacesRemoveRepositoryForSecretForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesGetForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_codespace> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesUpdateForAuthenticatedUser = ( params: Params< @@ -6737,17 +9389,41 @@ export type CodespacesUpdateForAuthenticatedUser = ( t_CodespacesUpdateForAuthenticatedUserBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_codespace> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type CodespacesDeleteForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 202, + { + [key: string]: unknown + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesExportForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<202, t_codespace_export_details> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> + | Response<500, t_basic_error> +> export type CodespacesGetExportDetailsForAuthenticatedUser = ( params: Params< @@ -6756,7 +9432,9 @@ export type CodespacesGetExportDetailsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_codespace_export_details> | Response<404, t_basic_error> +> export type CodespacesCodespaceMachinesForAuthenticatedUser = ( params: Params< @@ -6765,7 +9443,20 @@ export type CodespacesCodespaceMachinesForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + machines: t_codespace_machine[] + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesPublishForAuthenticatedUser = ( params: Params< @@ -6774,17 +9465,39 @@ export type CodespacesPublishForAuthenticatedUser = ( t_CodespacesPublishForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_codespace_with_full_repository> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type CodespacesStartForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_codespace> + | Response<304, void> + | Response<400, t_scim_error> + | Response<401, t_basic_error> + | Response<402, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<409, t_basic_error> + | Response<500, t_basic_error> +> export type CodespacesStopForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_codespace> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<500, t_basic_error> +> export type UsersSetPrimaryEmailVisibilityForAuthenticatedUser = ( params: Params< @@ -6793,12 +9506,25 @@ export type UsersSetPrimaryEmailVisibilityForAuthenticatedUser = ( t_UsersSetPrimaryEmailVisibilityForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_email[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersListEmailsForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_email[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersAddEmailForAuthenticatedUser = ( params: Params< @@ -6807,12 +9533,26 @@ export type UsersAddEmailForAuthenticatedUser = ( t_UsersAddEmailForAuthenticatedUserBodySchema | undefined >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_email[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersDeleteEmailForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersListFollowersForAuthenticatedUser = ( params: Params< @@ -6821,12 +9561,22 @@ export type UsersListFollowersForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_simple_user[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type UsersListFollowedByAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_simple_user[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type UsersCheckPersonIsFollowedByAuthenticated = ( params: Params< @@ -6835,32 +9585,69 @@ export type UsersCheckPersonIsFollowedByAuthenticated = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersFollow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersUnfollow = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersListGpgKeysForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gpg_key[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersCreateGpgKeyForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_gpg_key> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersGetGpgKeyForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_gpg_key> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersDeleteGpgKeyForAuthenticatedUser = ( params: Params< @@ -6869,7 +9656,14 @@ export type UsersDeleteGpgKeyForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type AppsListInstallationsForAuthenticatedUser = ( params: Params< @@ -6878,7 +9672,18 @@ export type AppsListInstallationsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + installations: t_installation[] + total_count: number + } + > + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type AppsListInstallationReposForAuthenticatedUser = ( params: Params< @@ -6887,7 +9692,19 @@ export type AppsListInstallationReposForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + repositories: t_repository[] + repository_selection?: string + total_count: number + } + > + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type AppsAddRepoToInstallationForAuthenticatedUser = ( params: Params< @@ -6896,7 +9713,12 @@ export type AppsAddRepoToInstallationForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type AppsRemoveRepoFromInstallationForAuthenticatedUser = ( params: Params< @@ -6905,12 +9727,25 @@ export type AppsRemoveRepoFromInstallationForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type InteractionsGetRestrictionsForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response< + 200, + { + [key: string]: unknown + } + > + | Response<204, void> +> export type InteractionsSetRestrictionsForAuthenticatedUser = ( params: Params< @@ -6919,17 +9754,22 @@ export type InteractionsSetRestrictionsForAuthenticatedUser = ( t_InteractionsSetRestrictionsForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_interaction_limit_response> + | Response<422, t_validation_error> +> export type InteractionsRemoveRestrictionsForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type IssuesListForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_issue[]> | Response<304, void> | Response<404, t_basic_error> +> export type UsersListPublicSshKeysForAuthenticatedUser = ( params: Params< @@ -6938,7 +9778,13 @@ export type UsersListPublicSshKeysForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_key[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersCreatePublicSshKeyForAuthenticatedUser = ( params: Params< @@ -6947,7 +9793,14 @@ export type UsersCreatePublicSshKeyForAuthenticatedUser = ( t_UsersCreatePublicSshKeyForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_key> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersGetPublicSshKeyForAuthenticatedUser = ( params: Params< @@ -6956,7 +9809,13 @@ export type UsersGetPublicSshKeyForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_key> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersDeletePublicSshKeyForAuthenticatedUser = ( params: Params< @@ -6965,7 +9824,13 @@ export type UsersDeletePublicSshKeyForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type AppsListSubscriptionsForAuthenticatedUser = ( params: Params< @@ -6974,7 +9839,12 @@ export type AppsListSubscriptionsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_user_marketplace_purchase[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<404, t_basic_error> +> export type AppsListSubscriptionsForAuthenticatedUserStubbed = ( params: Params< @@ -6983,7 +9853,11 @@ export type AppsListSubscriptionsForAuthenticatedUserStubbed = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_user_marketplace_purchase[]> + | Response<304, void> + | Response<401, t_basic_error> +> export type OrgsListMembershipsForAuthenticatedUser = ( params: Params< @@ -6992,7 +9866,13 @@ export type OrgsListMembershipsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_org_membership[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type OrgsGetMembershipForAuthenticatedUser = ( params: Params< @@ -7001,7 +9881,11 @@ export type OrgsGetMembershipForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_org_membership> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type OrgsUpdateMembershipForAuthenticatedUser = ( params: Params< @@ -7010,17 +9894,33 @@ export type OrgsUpdateMembershipForAuthenticatedUser = ( t_OrgsUpdateMembershipForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_org_membership> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type MigrationsListForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_migration[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type MigrationsStartForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_migration> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type MigrationsGetStatusForAuthenticatedUser = ( params: Params< @@ -7029,7 +9929,13 @@ export type MigrationsGetStatusForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_migration> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type MigrationsGetArchiveForAuthenticatedUser = ( params: Params< @@ -7038,7 +9944,12 @@ export type MigrationsGetArchiveForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<302, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type MigrationsDeleteArchiveForAuthenticatedUser = ( params: Params< @@ -7047,7 +9958,13 @@ export type MigrationsDeleteArchiveForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type MigrationsUnlockRepoForAuthenticatedUser = ( params: Params< @@ -7056,7 +9973,13 @@ export type MigrationsUnlockRepoForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type MigrationsListReposForAuthenticatedUser = ( params: Params< @@ -7065,12 +9988,19 @@ export type MigrationsListReposForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_minimal_repository[]> | Response<404, t_basic_error> +> export type OrgsListForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_organization_simple[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type PackagesListPackagesForAuthenticatedUser = ( params: Params< @@ -7079,7 +10009,7 @@ export type PackagesListPackagesForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesGetPackageForAuthenticatedUser = ( params: Params< @@ -7088,7 +10018,7 @@ export type PackagesGetPackageForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesDeletePackageForAuthenticatedUser = ( params: Params< @@ -7097,7 +10027,12 @@ export type PackagesDeletePackageForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesRestorePackageForAuthenticatedUser = ( params: Params< @@ -7106,7 +10041,12 @@ export type PackagesRestorePackageForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser = ( params: Params< @@ -7115,7 +10055,12 @@ export type PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_package_version[]> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesGetPackageVersionForAuthenticatedUser = ( params: Params< @@ -7124,7 +10069,7 @@ export type PackagesGetPackageVersionForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesDeletePackageVersionForAuthenticatedUser = ( params: Params< @@ -7133,7 +10078,12 @@ export type PackagesDeletePackageVersionForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesRestorePackageVersionForAuthenticatedUser = ( params: Params< @@ -7142,12 +10092,23 @@ export type PackagesRestorePackageVersionForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ProjectsCreateForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_project> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error_simple> +> export type UsersListPublicEmailsForAuthenticatedUser = ( params: Params< @@ -7156,17 +10117,37 @@ export type UsersListPublicEmailsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_email[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposListForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_repository[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<422, t_validation_error> +> export type ReposCreateForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_repository> + | Response<304, void> + | Response<400, t_scim_error> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type ReposListInvitationsForAuthenticatedUser = ( params: Params< @@ -7175,7 +10156,13 @@ export type ReposListInvitationsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_repository_invitation[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ReposAcceptInvitationForAuthenticatedUser = ( params: Params< @@ -7184,7 +10171,13 @@ export type ReposAcceptInvitationForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<409, t_basic_error> +> export type ReposDeclineInvitationForAuthenticatedUser = ( params: Params< @@ -7193,7 +10186,13 @@ export type ReposDeclineInvitationForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<409, t_basic_error> +> export type UsersListSshSigningKeysForAuthenticatedUser = ( params: Params< @@ -7202,7 +10201,13 @@ export type UsersListSshSigningKeysForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_ssh_signing_key[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersCreateSshSigningKeyForAuthenticatedUser = ( params: Params< @@ -7211,7 +10216,14 @@ export type UsersCreateSshSigningKeyForAuthenticatedUser = ( t_UsersCreateSshSigningKeyForAuthenticatedUserBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<201, t_ssh_signing_key> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type UsersGetSshSigningKeyForAuthenticatedUser = ( params: Params< @@ -7220,7 +10232,13 @@ export type UsersGetSshSigningKeyForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_ssh_signing_key> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersDeleteSshSigningKeyForAuthenticatedUser = ( params: Params< @@ -7229,7 +10247,13 @@ export type UsersDeleteSshSigningKeyForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActivityListReposStarredByAuthenticatedUser = ( params: Params< @@ -7238,7 +10262,12 @@ export type ActivityListReposStarredByAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_starred_repository[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type ActivityCheckRepoIsStarredByAuthenticatedUser = ( params: Params< @@ -7247,12 +10276,24 @@ export type ActivityCheckRepoIsStarredByAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActivityStarRepoForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActivityUnstarRepoForAuthenticatedUser = ( params: Params< @@ -7261,7 +10302,13 @@ export type ActivityUnstarRepoForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ActivityListWatchedReposForAuthenticatedUser = ( params: Params< @@ -7270,22 +10317,34 @@ export type ActivityListWatchedReposForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_minimal_repository[]> + | Response<304, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type TeamsListForAuthenticatedUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_team_full[]> + | Response<304, void> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type UsersList = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<304, void>> export type UsersGetByUsername = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response<200, t_private_user | t_public_user> | Response<404, t_basic_error> +> export type ActivityListEventsForAuthenticatedUser = ( params: Params< @@ -7294,7 +10353,7 @@ export type ActivityListEventsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListOrgEventsForAuthenticatedUser = ( params: Params< @@ -7303,7 +10362,7 @@ export type ActivityListOrgEventsForAuthenticatedUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListPublicEventsForUser = ( params: Params< @@ -7312,7 +10371,7 @@ export type ActivityListPublicEventsForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type UsersListFollowersForUser = ( params: Params< @@ -7321,7 +10380,7 @@ export type UsersListFollowersForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type UsersListFollowingForUser = ( params: Params< @@ -7330,12 +10389,12 @@ export type UsersListFollowingForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type UsersCheckFollowingForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, void>> export type GistsListForUser = ( params: Params< @@ -7344,7 +10403,7 @@ export type GistsListForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type UsersListGpgKeysForUser = ( params: Params< @@ -7353,7 +10412,7 @@ export type UsersListGpgKeysForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type UsersGetContextForUser = ( params: Params< @@ -7362,12 +10421,16 @@ export type UsersGetContextForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_hovercard> + | Response<404, t_basic_error> + | Response<422, t_validation_error> +> export type AppsGetUserInstallation = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type UsersListPublicKeysForUser = ( params: Params< @@ -7376,7 +10439,7 @@ export type UsersListPublicKeysForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type OrgsListForUser = ( params: Params< @@ -7385,7 +10448,7 @@ export type OrgsListForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesListPackagesForUser = ( params: Params< @@ -7394,17 +10457,26 @@ export type PackagesListPackagesForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_package[]> + | Response<401, t_basic_error> + | Response<403, t_basic_error> +> export type PackagesGetPackageForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesDeletePackageForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesRestorePackageForUser = ( params: Params< @@ -7413,7 +10485,12 @@ export type PackagesRestorePackageForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesGetAllPackageVersionsForPackageOwnedByUser = ( params: Params< @@ -7422,22 +10499,37 @@ export type PackagesGetAllPackageVersionsForPackageOwnedByUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_package_version[]> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesGetPackageVersionForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type PackagesDeletePackageVersionForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type PackagesRestorePackageVersionForUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response<401, t_basic_error> + | Response<403, t_basic_error> + | Response<404, t_basic_error> +> export type ProjectsListForUser = ( params: Params< @@ -7446,7 +10538,7 @@ export type ProjectsListForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<422, t_validation_error>> export type ActivityListReceivedEventsForUser = ( params: Params< @@ -7455,7 +10547,7 @@ export type ActivityListReceivedEventsForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListReceivedPublicEventsForUser = ( params: Params< @@ -7464,7 +10556,7 @@ export type ActivityListReceivedPublicEventsForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ReposListForUser = ( params: Params< @@ -7473,22 +10565,22 @@ export type ReposListForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type BillingGetGithubActionsBillingUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type BillingGetGithubPackagesBillingUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type BillingGetSharedStorageBillingUser = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type UsersListSshSigningKeysForUser = ( params: Params< @@ -7497,7 +10589,7 @@ export type UsersListSshSigningKeysForUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type ActivityListReposStarredByUser = ( params: Params< @@ -7506,7 +10598,14 @@ export type ActivityListReposStarredByUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + Response< + 200, + { + [key: string]: unknown + } + > +> export type ActivityListReposWatchedByUser = ( params: Params< @@ -7515,17 +10614,17 @@ export type ActivityListReposWatchedByUser = ( void >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type MetaGetAllVersions = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response<404, t_basic_error>> export type MetaGetZen = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type Implementation = { metaRoot: MetaRoot @@ -8413,46 +11512,49 @@ export function bootstrap( const { status, body } = await implementation.metaRoot(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - current_user_url: z.coerce.string(), - current_user_authorizations_html_url: z.coerce.string(), - authorizations_url: z.coerce.string(), - code_search_url: z.coerce.string(), - commit_search_url: z.coerce.string(), - emails_url: z.coerce.string(), - emojis_url: z.coerce.string(), - events_url: z.coerce.string(), - feeds_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - hub_url: z.coerce.string(), - issue_search_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - label_search_url: z.coerce.string(), - notifications_url: z.coerce.string(), - organization_url: z.coerce.string(), - organization_repositories_url: z.coerce.string(), - organization_teams_url: z.coerce.string(), - public_gists_url: z.coerce.string(), - rate_limit_url: z.coerce.string(), - repository_url: z.coerce.string(), - repository_search_url: z.coerce.string(), - current_user_repositories_url: z.coerce.string(), - starred_url: z.coerce.string(), - starred_gists_url: z.coerce.string(), - topic_search_url: z.coerce.string().optional(), - user_url: z.coerce.string(), - user_organizations_url: z.coerce.string(), - user_repositories_url: z.coerce.string(), - user_search_url: z.coerce.string(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + current_user_url: z.coerce.string(), + current_user_authorizations_html_url: z.coerce.string(), + authorizations_url: z.coerce.string(), + code_search_url: z.coerce.string(), + commit_search_url: z.coerce.string(), + emails_url: z.coerce.string(), + emojis_url: z.coerce.string(), + events_url: z.coerce.string(), + feeds_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + hub_url: z.coerce.string(), + issue_search_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + label_search_url: z.coerce.string(), + notifications_url: z.coerce.string(), + organization_url: z.coerce.string(), + organization_repositories_url: z.coerce.string(), + organization_teams_url: z.coerce.string(), + public_gists_url: z.coerce.string(), + rate_limit_url: z.coerce.string(), + repository_url: z.coerce.string(), + repository_search_url: z.coerce.string(), + current_user_repositories_url: z.coerce.string(), + starred_url: z.coerce.string(), + starred_gists_url: z.coerce.string(), + topic_search_url: z.coerce.string().optional(), + user_url: z.coerce.string(), + user_organizations_url: z.coerce.string(), + user_repositories_url: z.coerce.string(), + user_search_url: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -8469,58 +11571,61 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -8547,27 +11652,87 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "201", + z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .merge( + z.object({ + client_id: z.coerce.string(), + client_secret: z.coerce.string(), + webhook_secret: z.coerce.string(), + pem: z.coerce.string(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -8588,17 +11753,20 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -8627,17 +11795,20 @@ export function bootstrap( const { status, body } = await implementation.appsUpdateWebhookConfigForApp(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -8667,60 +11838,63 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), + ], + [ + "400", z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -8748,64 +11922,70 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - url: z.coerce.string().optional(), - request: z.object({ headers: z.object({}), payload: z.object({}) }), - response: z.object({ - headers: z.object({}), - payload: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ + headers: z.object({}), + payload: z.object({}), + }), + response: z.object({ + headers: z.object({}), + payload: z.coerce.string(), + }), }), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -8831,44 +12011,46 @@ export function bootstrap( const { status, body } = await implementation.appsRedeliverWebhookDelivery(input, ctx) - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -8896,9 +12078,138 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsGetInstallationParamSchema = z.object({ + installation_id: z.coerce.number(), + }) + + router.get( + "appsGetInstallation", + "/app/installations/:installationId", + async (ctx, next) => { + const input = { + params: parseRequestInput(appsGetInstallationParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.appsGetInstallation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), account: z.object({}), @@ -8990,137 +12301,20 @@ export function bootstrap( }), suspended_at: z.coerce.string().datetime({ offset: true }), contact_email: z.coerce.string().optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsGetInstallationParamSchema = z.object({ - installation_id: z.coerce.number(), - }) - - router.get( - "appsGetInstallation", - "/app/installations/:installationId", - async (ctx, next) => { - const input = { - params: parseRequestInput(appsGetInstallationParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.appsGetInstallation( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z.enum(["read", "write"]).optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z.enum(["read", "write"]).optional(), - team_discussions: z.enum(["read", "write"]).optional(), }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -9148,17 +12342,21 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -9235,640 +12433,32 @@ export function bootstrap( const { status, body } = await implementation.appsCreateInstallationAccessToken(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - token: z.coerce.string(), - expires_at: z.coerce.string(), - permissions: z - .object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }) - .optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string(), + permissions: z + .object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsSuspendInstallationParamSchema = z.object({ - installation_id: z.coerce.number(), - }) - - router.put( - "appsSuspendInstallation", - "/app/installations/:installationId/suspended", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsSuspendInstallationParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.appsSuspendInstallation( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsUnsuspendInstallationParamSchema = z.object({ - installation_id: z.coerce.number(), - }) - - router.delete( - "appsUnsuspendInstallation", - "/app/installations/:installationId/suspended", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsUnsuspendInstallationParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.appsUnsuspendInstallation( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsDeleteAuthorizationParamSchema = z.object({ - client_id: z.coerce.string(), - }) - - const appsDeleteAuthorizationBodySchema = z.object({ - access_token: z.coerce.string(), - }) - - router.delete( - "appsDeleteAuthorization", - "/applications/:clientId/grant", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsDeleteAuthorizationParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(appsDeleteAuthorizationBodySchema, ctx.body), - } - - const { status, body } = await implementation.appsDeleteAuthorization( - input, - ctx - ) - - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsCheckTokenParamSchema = z.object({ client_id: z.coerce.string() }) - - const appsCheckTokenBodySchema = z.object({ access_token: z.coerce.string() }) - - router.post( - "appsCheckToken", - "/applications/:clientId/token", - async (ctx, next) => { - const input = { - params: parseRequestInput(appsCheckTokenParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(appsCheckTokenBodySchema, ctx.body), - } - - const { status, body } = await implementation.appsCheckToken(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) .optional(), secret_scanning_alerts: z.enum(["read", "write"]).optional(), secrets: z.enum(["read", "write"]).optional(), @@ -9901,198 +12491,560 @@ export function bootstrap( .enum(["read", "write"]) .optional(), team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), }) - ) - .optional(), - }) - .parse(body) + .optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsSuspendInstallationParamSchema = z.object({ + installation_id: z.coerce.number(), + }) + + router.put( + "appsSuspendInstallation", + "/app/installations/:installationId/suspended", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsSuspendInstallationParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = await implementation.appsSuspendInstallation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsResetTokenParamSchema = z.object({ client_id: z.coerce.string() }) + const appsUnsuspendInstallationParamSchema = z.object({ + installation_id: z.coerce.number(), + }) - const appsResetTokenBodySchema = z.object({ access_token: z.coerce.string() }) + router.delete( + "appsUnsuspendInstallation", + "/app/installations/:installationId/suspended", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsUnsuspendInstallationParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - router.patch( - "appsResetToken", + const { status, body } = await implementation.appsUnsuspendInstallation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsDeleteAuthorizationParamSchema = z.object({ + client_id: z.coerce.string(), + }) + + const appsDeleteAuthorizationBodySchema = z.object({ + access_token: z.coerce.string(), + }) + + router.delete( + "appsDeleteAuthorization", + "/applications/:clientId/grant", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsDeleteAuthorizationParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(appsDeleteAuthorizationBodySchema, ctx.body), + } + + const { status, body } = await implementation.appsDeleteAuthorization( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsCheckTokenParamSchema = z.object({ client_id: z.coerce.string() }) + + const appsCheckTokenBodySchema = z.object({ access_token: z.coerce.string() }) + + router.post( + "appsCheckToken", "/applications/:clientId/token", async (ctx, next) => { const input = { - params: parseRequestInput(appsResetTokenParamSchema, ctx.params), + params: parseRequestInput(appsCheckTokenParamSchema, ctx.params), query: undefined, - body: parseRequestInput(appsResetTokenBodySchema, ctx.body), + body: parseRequestInput(appsCheckTokenBodySchema, ctx.body), } - const { status, body } = await implementation.appsResetToken(input, ctx) + const { status, body } = await implementation.appsCheckToken(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -10114,37 +13066,312 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), }) - ) - .optional(), - }) - .parse(body) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z + .enum(["read", "write"]) + .optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsResetTokenParamSchema = z.object({ client_id: z.coerce.string() }) + + const appsResetTokenBodySchema = z.object({ access_token: z.coerce.string() }) + + router.patch( + "appsResetToken", + "/applications/:clientId/token", + async (ctx, next) => { + const input = { + params: parseRequestInput(appsResetTokenParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(appsResetTokenBodySchema, ctx.body), } + const { status, body } = await implementation.appsResetToken(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z + .enum(["read", "write"]) + .optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10168,31 +13395,35 @@ export function bootstrap( const { status, body } = await implementation.appsDeleteToken(input, ctx) - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10257,109 +13488,29 @@ export function bootstrap( const { status, body } = await implementation.appsScopeToken(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -10381,181 +13532,273 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsGetBySlugParamSchema = z.object({ app_slug: z.coerce.string() }) - - router.get("appsGetBySlug", "/apps/:appSlug", async (ctx, next) => { - const input = { - params: parseRequestInput(appsGetBySlugParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.appsGetBySlug(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - router.get( - "codesOfConductGetAllCodesOfConduct", - "/codes_of_conduct", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codesOfConductGetAllCodesOfConduct(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z + .enum(["read", "write"]) + .optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsGetBySlugParamSchema = z.object({ app_slug: z.coerce.string() }) + + router.get("appsGetBySlug", "/apps/:appSlug", async (ctx, next) => { + const input = { + params: parseRequestInput(appsGetBySlugParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.appsGetBySlug(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - ) - .parse(body) + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + router.get( + "codesOfConductGetAllCodesOfConduct", + "/codes_of_conduct", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, } + const { status, body } = + await implementation.codesOfConductGetAllCodesOfConduct(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10581,27 +13824,31 @@ export function bootstrap( const { status, body } = await implementation.codesOfConductGetConductCode(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }), + ], + ["304", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10616,10 +13863,13 @@ export function bootstrap( const { status, body } = await implementation.emojisGet(input, ctx) - if (status === 200) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["200", z.object({})], + ["304", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -10646,6 +13896,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -10683,28 +13937,33 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - runner_groups: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_organizations_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runner_groups: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce + .boolean() + .optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10746,23 +14005,26 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_organizations_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10793,23 +14055,26 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_organizations_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10841,6 +14106,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -10872,6 +14141,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -10899,6 +14172,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -10926,30 +14203,33 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -10983,38 +14263,41 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -11042,29 +14325,33 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - advanced_security_enabled_for_new_repositories: z.coerce.boolean(), - secret_scanning_enabled_for_new_repositories: z.coerce.boolean(), - secret_scanning_push_protection_enabled_for_new_repositories: - z.coerce.boolean(), - secret_scanning_push_protection_custom_link: z.coerce - .string() - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + advanced_security_enabled_for_new_repositories: + z.coerce.boolean(), + secret_scanning_enabled_for_new_repositories: z.coerce.boolean(), + secret_scanning_push_protection_enabled_for_new_repositories: + z.coerce.boolean(), + secret_scanning_push_protection_custom_link: z.coerce + .string() + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -11110,17 +14397,22 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -11164,116 +14456,81 @@ export function bootstrap( const { status, body } = await implementation.dependabotListAlertsForEnterprise(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ ecosystem: z.coerce.string(), name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -11296,178 +14553,16 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const secretScanningListAlertsForEnterpriseParamSchema = z.object({ - enterprise: z.coerce.string(), - }) - - const secretScanningListAlertsForEnterpriseQuerySchema = z.object({ - state: z.enum(["open", "resolved"]).optional(), - secret_type: z.coerce.string().optional(), - resolution: z.coerce.string().optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - }) - - router.get( - "secretScanningListAlertsForEnterprise", - "/enterprises/:enterprise/secret-scanning/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningListAlertsForEnterpriseParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListAlertsForEnterpriseQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.secretScanningListAlertsForEnterprise(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - repository: z - .object({ + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), @@ -11536,61 +14631,265 @@ export function bootstrap( teams_url: z.coerce.string(), trees_url: z.coerce.string(), hooks_url: z.coerce.string(), - }) - .optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolution_comment: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + }), + }) + ), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const secretScanningListAlertsForEnterpriseParamSchema = z.object({ + enterprise: z.coerce.string(), + }) + + const secretScanningListAlertsForEnterpriseQuerySchema = z.object({ + state: z.enum(["open", "resolved"]).optional(), + secret_type: z.coerce.string().optional(), + resolution: z.coerce.string().optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + }) + + router.get( + "secretScanningListAlertsForEnterprise", + "/enterprises/:enterprise/secret-scanning/alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningListAlertsForEnterpriseParamSchema, + ctx.params + ), + query: parseRequestInput( + secretScanningListAlertsForEnterpriseQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.secretScanningListAlertsForEnterprise(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }) + .optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -11626,17 +14925,22 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -11659,152 +14963,57 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ id: z.coerce.number(), - node_id: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -11827,34 +15036,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -11876,27 +15072,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -11919,279 +15098,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + ) + .optional(), + milestone: z.object({ url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), + html_url: z.coerce.string(), labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -12214,104 +15133,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -12333,387 +15182,652 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - router.get("activityGetFeeds", "/feeds", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.activityGetFeeds(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - timeline_url: z.coerce.string(), - user_url: z.coerce.string(), - current_user_public_url: z.coerce.string().optional(), - current_user_url: z.coerce.string().optional(), - current_user_actor_url: z.coerce.string().optional(), - current_user_organization_url: z.coerce.string().optional(), - current_user_organization_urls: z.array(z.coerce.string()).optional(), - security_advisories_url: z.coerce.string().optional(), - repository_discussions_url: z.coerce.string().optional(), - repository_discussions_category_url: z.coerce.string().optional(), - _links: z.object({ - timeline: z.object({ - href: z.coerce.string(), - type: z.coerce.string(), - }), - user: z.object({ - href: z.coerce.string(), - type: z.coerce.string(), - }), - security_advisories: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_public: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_actor: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_organization: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_organizations: z - .array( - z.object({ href: z.coerce.string(), type: z.coerce.string() }) - ) - .optional(), - repository_discussions: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - repository_discussions_category: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - }), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const gistsListQuerySchema = z.object({ - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("gistsList", "/gists", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(gistsListQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsList(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const gistsCreateBodySchema = z.object({ - description: z.coerce.string().optional(), - files: z.object({}), - public: z.union([z.coerce.boolean(), z.enum(["true", "false"])]), - }) - - router.post("gistsCreate", "/gists", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput(gistsCreateBodySchema, ctx.body), - } - - const { status, body } = await implementation.gistsCreate(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z .object({ - collaborators: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z + comment: z .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + router.get("activityGetFeeds", "/feeds", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.activityGetFeeds(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + timeline_url: z.coerce.string(), + user_url: z.coerce.string(), + current_user_public_url: z.coerce.string().optional(), + current_user_url: z.coerce.string().optional(), + current_user_actor_url: z.coerce.string().optional(), + current_user_organization_url: z.coerce.string().optional(), + current_user_organization_urls: z + .array(z.coerce.string()) + .optional(), + security_advisories_url: z.coerce.string().optional(), + repository_discussions_url: z.coerce.string().optional(), + repository_discussions_category_url: z.coerce.string().optional(), + _links: z.object({ + timeline: z.object({ + href: z.coerce.string(), + type: z.coerce.string(), + }), + user: z.object({ + href: z.coerce.string(), + type: z.coerce.string(), + }), + security_advisories: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_public: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_actor: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_organization: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_organizations: z + .array( + z.object({ href: z.coerce.string(), type: z.coerce.string() }) + ) + .optional(), + repository_discussions: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + repository_discussions_category: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const gistsListQuerySchema = z.object({ + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("gistsList", "/gists", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(gistsListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gistsList(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ url: z.coerce.string(), forks_url: z.coerce.string(), commits_url: z.coerce.string(), @@ -12781,423 +15895,199 @@ export function bootstrap( forks: z.array(z.object({})).optional(), history: z.array(z.object({})).optional(), }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const gistsListPublicQuerySchema = z.object({ - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("gistsListPublic", "/gists/public", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(gistsListPublicQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsListPublic(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + ), + ], + ["304", z.void()], + [ + "403", z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) - const gistsListStarredQuerySchema = z.object({ - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const gistsCreateBodySchema = z.object({ + description: z.coerce.string().optional(), + files: z.object({}), + public: z.union([z.coerce.boolean(), z.enum(["true", "false"])]), }) - router.get("gistsListStarred", "/gists/starred", async (ctx, next) => { + router.post("gistsCreate", "/gists", async (ctx, next) => { const input = { params: undefined, - query: parseRequestInput(gistsListStarredQuerySchema, ctx.query), - body: undefined, + query: undefined, + body: parseRequestInput(gistsCreateBodySchema, ctx.body), } - const { status, body } = await implementation.gistsListStarred(input, ctx) + const { status, body } = await implementation.gistsCreate(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const gistsGetParamSchema = z.object({ gist_id: z.coerce.string() }) - - router.get("gistsGet", "/gists/:gistId", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsGetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gistsGet(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -13222,39 +16112,29 @@ export function bootstrap( starred_at: z.coerce.string().optional(), }) .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -13276,245 +16156,81 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - block: z - .object({ - reason: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) - const gistsUpdateParamSchema = z.object({ gist_id: z.coerce.string() }) - - const gistsUpdateBodySchema = z.object({ - description: z.coerce.string().optional(), - files: z.object({}).optional(), + const gistsListPublicQuerySchema = z.object({ + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.patch("gistsUpdate", "/gists/:gistId", async (ctx, next) => { + router.get("gistsListPublic", "/gists/public", async (ctx, next) => { const input = { - params: parseRequestInput(gistsUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gistsUpdateBodySchema, ctx.body), + params: undefined, + query: parseRequestInput(gistsListPublicQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.gistsUpdate(input, ctx) + const { status, body } = await implementation.gistsListPublic(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ url: z.coerce.string(), forks_url: z.coerce.string(), commits_url: z.coerce.string(), @@ -13582,154 +16298,83 @@ export function bootstrap( forks: z.array(z.object({})).optional(), history: z.array(z.object({})).optional(), }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const gistsDeleteParamSchema = z.object({ gist_id: z.coerce.string() }) - - router.delete("gistsDelete", "/gists/:gistId", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsDeleteParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gistsDelete(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) - const gistsListCommentsParamSchema = z.object({ gist_id: z.coerce.string() }) - - const gistsListCommentsQuerySchema = z.object({ + const gistsListStarredQuerySchema = z.object({ + since: z.coerce.string().datetime({ offset: true }).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "gistsListComments", - "/gists/:gistId/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput(gistsListCommentsParamSchema, ctx.params), - query: parseRequestInput(gistsListCommentsQuerySchema, ctx.query), - body: undefined, - } + router.get("gistsListStarred", "/gists/starred", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(gistsListStarredQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = await implementation.gistsListComments( - input, - ctx - ) + const { status, body } = await implementation.gistsListStarred(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -13753,453 +16398,358 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + ), + ], + ["304", z.void()], + [ + "401", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gistsCreateCommentParamSchema = z.object({ gist_id: z.coerce.string() }) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const gistsCreateCommentBodySchema = z.object({ body: z.coerce.string() }) + const gistsGetParamSchema = z.object({ gist_id: z.coerce.string() }) - router.post( - "gistsCreateComment", - "/gists/:gistId/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput(gistsCreateCommentParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gistsCreateCommentBodySchema, ctx.body), - } + router.get("gistsGet", "/gists/:gistId", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsGetParamSchema, ctx.params), + query: undefined, + body: undefined, + } - const { status, body } = await implementation.gistsCreateComment( - input, - ctx - ) + const { status, body } = await implementation.gistsGet(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + block: z + .object({ + reason: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gistsGetCommentParamSchema = z.object({ - gist_id: z.coerce.string(), - comment_id: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - router.get( - "gistsGetComment", - "/gists/:gistId/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(gistsGetCommentParamSchema, ctx.params), - query: undefined, - body: undefined, - } + const gistsUpdateParamSchema = z.object({ gist_id: z.coerce.string() }) - const { status, body } = await implementation.gistsGetComment(input, ctx) + const gistsUpdateBodySchema = z.object({ + description: z.coerce.string().optional(), + files: z.object({}).optional(), + }) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - block: z - .object({ - reason: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gistsUpdateCommentParamSchema = z.object({ - gist_id: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const gistsUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) - - router.patch( - "gistsUpdateComment", - "/gists/:gistId/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(gistsUpdateCommentParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gistsUpdateCommentBodySchema, ctx.body), - } - - const { status, body } = await implementation.gistsUpdateComment( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gistsDeleteCommentParamSchema = z.object({ - gist_id: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - router.delete( - "gistsDeleteComment", - "/gists/:gistId/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(gistsDeleteCommentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gistsDeleteComment( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gistsListCommitsParamSchema = z.object({ gist_id: z.coerce.string() }) - - const gistsListCommitsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "gistsListCommits", - "/gists/:gistId/commits", - async (ctx, next) => { - const input = { - params: parseRequestInput(gistsListCommitsParamSchema, ctx.params), - query: parseRequestInput(gistsListCommitsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsListCommits(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - version: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - change_status: z.object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }), - committed_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gistsListForksParamSchema = z.object({ gist_id: z.coerce.string() }) - - const gistsListForksQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("gistsListForks", "/gists/:gistId/forks", async (ctx, next) => { + router.patch("gistsUpdate", "/gists/:gistId", async (ctx, next) => { const input = { - params: parseRequestInput(gistsListForksParamSchema, ctx.params), - query: parseRequestInput(gistsListForksQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(gistsUpdateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gistsUpdateBodySchema, ctx.body), } - const { status, body } = await implementation.gistsListForks(input, ctx) + const { status, body } = await implementation.gistsUpdate(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ forks: z .array( @@ -14426,415 +16976,302 @@ export function bootstrap( }) .optional(), truncated: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) - const gistsForkParamSchema = z.object({ gist_id: z.coerce.string() }) + const gistsDeleteParamSchema = z.object({ gist_id: z.coerce.string() }) - router.post("gistsFork", "/gists/:gistId/forks", async (ctx, next) => { + router.delete("gistsDelete", "/gists/:gistId", async (ctx, next) => { const input = { - params: parseRequestInput(gistsForkParamSchema, ctx.params), + params: parseRequestInput(gistsDeleteParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.gistsFork(input, ctx) + const { status, body } = await implementation.gistsDelete(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) - const gistsCheckIsStarredParamSchema = z.object({ - gist_id: z.coerce.string(), + const gistsListCommentsParamSchema = z.object({ gist_id: z.coerce.string() }) + + const gistsListCommentsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "gistsCheckIsStarred", - "/gists/:gistId/star", + "gistsListComments", + "/gists/:gistId/comments", async (ctx, next) => { const input = { - params: parseRequestInput(gistsCheckIsStarredParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(gistsListCommentsParamSchema, ctx.params), + query: parseRequestInput(gistsListCommentsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.gistsCheckIsStarred( + const { status, body } = await implementation.gistsListComments( input, ctx ) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gistsStarParamSchema = z.object({ gist_id: z.coerce.string() }) - - router.put("gistsStar", "/gists/:gistId/star", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsStarParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gistsStar(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const gistsUnstarParamSchema = z.object({ gist_id: z.coerce.string() }) - - router.delete("gistsUnstar", "/gists/:gistId/star", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsUnstarParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gistsUnstar(input, ctx) + const gistsCreateCommentParamSchema = z.object({ gist_id: z.coerce.string() }) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const gistsCreateCommentBodySchema = z.object({ body: z.coerce.string() }) - ctx.status = status - return next() - }) + router.post( + "gistsCreateComment", + "/gists/:gistId/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput(gistsCreateCommentParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gistsCreateCommentBodySchema, ctx.body), + } - const gistsGetRevisionParamSchema = z.object({ - gist_id: z.coerce.string(), - sha: z.coerce.string(), - }) + const { status, body } = await implementation.gistsCreateComment( + input, + ctx + ) - router.get("gistsGetRevision", "/gists/:gistId/:sha", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsGetRevisionParamSchema, ctx.params), - query: undefined, - body: undefined, + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.gistsGetRevision(input, ctx) + const gistsGetCommentParamSchema = z.object({ + gist_id: z.coerce.string(), + comment_id: z.coerce.number(), + }) - if (status === 200) { - ctx.body = z - .object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), + router.get( + "gistsGetComment", + "/gists/:gistId/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(gistsGetCommentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gistsGetComment(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), + url: z.coerce.string(), + body: z.coerce.string(), user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -14858,255 +17295,215 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - comments_url: z.coerce.string(), - owner: z + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + block: z .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + reason: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), }) .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const gistsUpdateCommentParamSchema = z.object({ + gist_id: z.coerce.string(), + comment_id: z.coerce.number(), }) - router.get( - "gitignoreGetAllTemplates", - "/gitignore/templates", + const gistsUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) + + router.patch( + "gistsUpdateComment", + "/gists/:gistId/comments/:commentId", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput(gistsUpdateCommentParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(gistsUpdateCommentBodySchema, ctx.body), } - const { status, body } = await implementation.gitignoreGetAllTemplates( + const { status, body } = await implementation.gistsUpdateComment( input, ctx ) - if (status === 200) { - ctx.body = z.array(z.coerce.string()).parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitignoreGetTemplateParamSchema = z.object({ name: z.coerce.string() }) + const gistsDeleteCommentParamSchema = z.object({ + gist_id: z.coerce.string(), + comment_id: z.coerce.number(), + }) - router.get( - "gitignoreGetTemplate", - "/gitignore/templates/:name", + router.delete( + "gistsDeleteComment", + "/gists/:gistId/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(gitignoreGetTemplateParamSchema, ctx.params), + params: parseRequestInput(gistsDeleteCommentParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.gitignoreGetTemplate( + const { status, body } = await implementation.gistsDeleteComment( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ name: z.coerce.string(), source: z.coerce.string() }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsListReposAccessibleToInstallationQuerySchema = z.object({ + const gistsListCommitsParamSchema = z.object({ gist_id: z.coerce.string() }) + + const gistsListCommitsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "appsListReposAccessibleToInstallation", - "/installation/repositories", + "gistsListCommits", + "/gists/:gistId/commits", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - appsListReposAccessibleToInstallationQuerySchema, - ctx.query - ), + params: parseRequestInput(gistsListCommitsParamSchema, ctx.params), + query: parseRequestInput(gistsListCommitsQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.appsListReposAccessibleToInstallation(input, ctx) + const { status, body } = await implementation.gistsListCommits(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + url: z.coerce.string(), + version: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15129,326 +17526,352 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), + change_status: z.object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }), + committed_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gistsListForksParamSchema = z.object({ gist_id: z.coerce.string() }) + + const gistsListForksQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("gistsListForks", "/gists/:gistId/forks", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsListForksParamSchema, ctx.params), + query: parseRequestInput(gistsListForksQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gistsListForks(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z + user: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() + created_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + updated_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + url: z.coerce.string().optional(), }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - repository_selection: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + ), + ], + ["304", z.void()], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - router.delete( - "appsRevokeInstallationAccessToken", - "/installation/token", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.appsRevokeInstallationAccessToken(input, ctx) - - ctx.status = status - return next() - } - ) - - const issuesListQuerySchema = z.object({ - filter: z - .enum(["assigned", "created", "mentioned", "subscribed", "repos", "all"]) - .optional(), - state: z.enum(["open", "closed", "all"]).optional(), - labels: z.coerce.string().optional(), - sort: z.enum(["created", "updated", "comments"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - collab: z.coerce.boolean().optional(), - orgs: z.coerce.boolean().optional(), - owned: z.coerce.boolean().optional(), - pulls: z.coerce.boolean().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - router.get("issuesList", "/issues", async (ctx, next) => { + const gistsForkParamSchema = z.object({ gist_id: z.coerce.string() }) + + router.post("gistsFork", "/gists/:gistId/forks", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput(issuesListQuerySchema, ctx.query), + params: parseRequestInput(gistsForkParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.issuesList(input, ctx) + const { status, body } = await implementation.gistsFork(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -15472,81 +17895,9 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + comments_url: z.coerce.string(), + owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15568,34 +17919,402 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const gistsCheckIsStarredParamSchema = z.object({ + gist_id: z.coerce.string(), + }) + + router.get( + "gistsCheckIsStarred", + "/gists/:gistId/star", + async (ctx, next) => { + const input = { + params: parseRequestInput(gistsCheckIsStarredParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gistsCheckIsStarred( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["404", z.object({})], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gistsStarParamSchema = z.object({ gist_id: z.coerce.string() }) + + router.put("gistsStar", "/gists/:gistId/star", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsStarParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gistsStar(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const gistsUnstarParamSchema = z.object({ gist_id: z.coerce.string() }) + + router.delete("gistsUnstar", "/gists/:gistId/star", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsUnstarParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gistsUnstar(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const gistsGetRevisionParamSchema = z.object({ + gist_id: z.coerce.string(), + sha: z.coerce.string(), + }) + + router.get("gistsGetRevision", "/gists/:gistId/:sha", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsGetRevisionParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gistsGetRevision(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), }) .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -15620,25 +18339,606 @@ export function bootstrap( starred_at: z.coerce.string().optional(), }) .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + truncated: z.coerce.boolean().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + router.get( + "gitignoreGetAllTemplates", + "/gitignore/templates", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitignoreGetAllTemplates( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitignoreGetTemplateParamSchema = z.object({ name: z.coerce.string() }) + + router.get( + "gitignoreGetTemplate", + "/gitignore/templates/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitignoreGetTemplateParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitignoreGetTemplate( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ name: z.coerce.string(), source: z.coerce.string() }), + ], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListReposAccessibleToInstallationQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListReposAccessibleToInstallation", + "/installation/repositories", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListReposAccessibleToInstallationQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.appsListReposAccessibleToInstallation(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + repository_selection: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + router.delete( + "appsRevokeInstallationAccessToken", + "/installation/token", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.appsRevokeInstallationAccessToken(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const issuesListQuerySchema = z.object({ + filter: z + .enum(["assigned", "created", "mentioned", "subscribed", "repos", "all"]) + .optional(), + state: z.enum(["open", "closed", "all"]).optional(), + labels: z.coerce.string().optional(), + sort: z.enum(["created", "updated", "comments"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + collab: z.coerce.boolean().optional(), + orgs: z.coerce.boolean().optional(), + owned: z.coerce.boolean().optional(), + pulls: z.coerce.boolean().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("issuesList", "/issues", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(issuesListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesList(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15661,18 +18961,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15695,241 +18996,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15951,511 +19045,401 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const licensesGetAllCommonlyUsedQuerySchema = z.object({ - featured: z.coerce.boolean().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("licensesGetAllCommonlyUsed", "/licenses", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - licensesGetAllCommonlyUsedQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.licensesGetAllCommonlyUsed( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - }) - - const licensesGetParamSchema = z.object({ license: z.coerce.string() }) - - router.get("licensesGet", "/licenses/:license", async (ctx, next) => { - const input = { - params: parseRequestInput(licensesGetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.licensesGet(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - spdx_id: z.coerce.string(), - url: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - description: z.coerce.string(), - implementation: z.coerce.string(), - permissions: z.array(z.coerce.string()), - conditions: z.array(z.coerce.string()), - limitations: z.array(z.coerce.string()), - body: z.coerce.string(), - featured: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const markdownRenderBodySchema = z.object({ - text: z.coerce.string(), - mode: z.enum(["markdown", "gfm"]).optional(), - context: z.coerce.string().optional(), - }) - - router.post("markdownRender", "/markdown", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput(markdownRenderBodySchema, ctx.body), - } - - const { status, body } = await implementation.markdownRender(input, ctx) - - if (status === 200) { - ctx.body = z.coerce.string().parse(body) - } - - ctx.status = status - return next() - }) - - const markdownRenderRawBodySchema = z.coerce.string().optional() - - router.post("markdownRenderRaw", "/markdown/raw", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput(markdownRenderRawBodySchema, ctx.body), - } - - const { status, body } = await implementation.markdownRenderRaw(input, ctx) - - if (status === 200) { - ctx.body = z.coerce.string().parse(body) - } - - ctx.status = status - return next() - }) - - const appsGetSubscriptionPlanForAccountParamSchema = z.object({ - account_id: z.coerce.number(), - }) - - router.get( - "appsGetSubscriptionPlanForAccount", - "/marketplace_listing/accounts/:accountId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsGetSubscriptionPlanForAccountParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.appsGetSubscriptionPlanForAccount(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ - is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), - unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), }) .optional(), - }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsListPlansQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "appsListPlans", - "/marketplace_listing/plans", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(appsListPlansQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.appsListPlans(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsListAccountsForPlanParamSchema = z.object({ - plan_id: z.coerce.number(), - }) - - const appsListAccountsForPlanQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "appsListAccountsForPlan", - "/marketplace_listing/plans/:planId/accounts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsListAccountsForPlanParamSchema, - ctx.params - ), - query: parseRequestInput(appsListAccountsForPlanQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.appsListAccountsForPlan( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z .object({ - is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), - unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), - plan: z + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + ), + ], + ["304", z.void()], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ + }), + ], + [ + "422", + z.object({ message: z.coerce.string(), documentation_url: z.coerce.string(), errors: z @@ -16474,26 +19458,175 @@ export function bootstrap( }) ) .optional(), - }) - .parse(body) - } + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - ctx.status = status - return next() + const licensesGetAllCommonlyUsedQuerySchema = z.object({ + featured: z.coerce.boolean().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("licensesGetAllCommonlyUsed", "/licenses", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + licensesGetAllCommonlyUsedQuerySchema, + ctx.query + ), + body: undefined, } - ) - const appsGetSubscriptionPlanForAccountStubbedParamSchema = z.object({ + const { status, body } = await implementation.licensesGetAllCommonlyUsed( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const licensesGetParamSchema = z.object({ license: z.coerce.string() }) + + router.get("licensesGet", "/licenses/:license", async (ctx, next) => { + const input = { + params: parseRequestInput(licensesGetParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.licensesGet(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + spdx_id: z.coerce.string(), + url: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + description: z.coerce.string(), + implementation: z.coerce.string(), + permissions: z.array(z.coerce.string()), + conditions: z.array(z.coerce.string()), + limitations: z.array(z.coerce.string()), + body: z.coerce.string(), + featured: z.coerce.boolean(), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const markdownRenderBodySchema = z.object({ + text: z.coerce.string(), + mode: z.enum(["markdown", "gfm"]).optional(), + context: z.coerce.string().optional(), + }) + + router.post("markdownRender", "/markdown", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput(markdownRenderBodySchema, ctx.body), + } + + const { status, body } = await implementation.markdownRender(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.coerce.string()], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const markdownRenderRawBodySchema = z.coerce.string().optional() + + router.post("markdownRenderRaw", "/markdown/raw", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput(markdownRenderRawBodySchema, ctx.body), + } + + const { status, body } = await implementation.markdownRenderRaw(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.coerce.string()], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const appsGetSubscriptionPlanForAccountParamSchema = z.object({ account_id: z.coerce.number(), }) router.get( - "appsGetSubscriptionPlanForAccountStubbed", - "/marketplace_listing/stubbed/accounts/:accountId", + "appsGetSubscriptionPlanForAccount", + "/marketplace_listing/accounts/:accountId", async (ctx, next) => { const input = { params: parseRequestInput( - appsGetSubscriptionPlanForAccountStubbedParamSchema, + appsGetSubscriptionPlanForAccountParamSchema, ctx.params ), query: undefined, @@ -16501,26 +19634,52 @@ export function bootstrap( } const { status, body } = - await implementation.appsGetSubscriptionPlanForAccountStubbed( - input, - ctx - ) + await implementation.appsGetSubscriptionPlanForAccount(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), plan: z .object({ url: z.coerce.string(), @@ -16538,113 +19697,105 @@ export function bootstrap( bullets: z.array(z.coerce.string()), }) .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), + }), }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsListPlansStubbedQuerySchema = z.object({ + const appsListPlansQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "appsListPlansStubbed", - "/marketplace_listing/stubbed/plans", + "appsListPlans", + "/marketplace_listing/plans", async (ctx, next) => { const input = { params: undefined, - query: parseRequestInput(appsListPlansStubbedQuerySchema, ctx.query), + query: parseRequestInput(appsListPlansQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.appsListPlansStubbed( - input, - ctx - ) + const { status, body } = await implementation.appsListPlans(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ), + ], + [ + "401", z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsListAccountsForPlanStubbedParamSchema = z.object({ + const appsListAccountsForPlanParamSchema = z.object({ plan_id: z.coerce.number(), }) - const appsListAccountsForPlanStubbedQuerySchema = z.object({ + const appsListAccountsForPlanQuerySchema = z.object({ sort: z.enum(["created", "updated"]).optional(), direction: z.enum(["asc", "desc"]).optional(), per_page: z.coerce.number().optional(), @@ -16652,27 +19803,165 @@ export function bootstrap( }) router.get( - "appsListAccountsForPlanStubbed", - "/marketplace_listing/stubbed/plans/:planId/accounts", + "appsListAccountsForPlan", + "/marketplace_listing/plans/:planId/accounts", async (ctx, next) => { const input = { params: parseRequestInput( - appsListAccountsForPlanStubbedParamSchema, + appsListAccountsForPlanParamSchema, ctx.params ), - query: parseRequestInput( - appsListAccountsForPlanStubbedQuerySchema, - ctx.query + query: parseRequestInput(appsListAccountsForPlanQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.appsListAccountsForPlan( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsGetSubscriptionPlanForAccountStubbedParamSchema = z.object({ + account_id: z.coerce.number(), + }) + + router.get( + "appsGetSubscriptionPlanForAccountStubbed", + "/marketplace_listing/stubbed/accounts/:accountId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsGetSubscriptionPlanForAccountStubbedParamSchema, + ctx.params ), + query: undefined, body: undefined, } const { status, body } = - await implementation.appsListAccountsForPlanStubbed(input, ctx) + await implementation.appsGetSubscriptionPlanForAccountStubbed( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ url: z.coerce.string(), type: z.coerce.string(), @@ -16731,20 +20020,193 @@ export function bootstrap( }) .optional(), }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListPlansStubbedQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListPlansStubbed", + "/marketplace_listing/stubbed/plans", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(appsListPlansStubbedQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.appsListPlansStubbed( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListAccountsForPlanStubbedParamSchema = z.object({ + plan_id: z.coerce.number(), + }) + + const appsListAccountsForPlanStubbedQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListAccountsForPlanStubbed", + "/marketplace_listing/stubbed/plans/:planId/accounts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsListAccountsForPlanStubbedParamSchema, + ctx.params + ), + query: parseRequestInput( + appsListAccountsForPlanStubbedQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.appsListAccountsForPlanStubbed(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -16759,32 +20221,36 @@ export function bootstrap( const { status, body } = await implementation.metaGet(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - verifiable_password_authentication: z.coerce.boolean(), - ssh_key_fingerprints: z - .object({ - SHA256_RSA: z.coerce.string().optional(), - SHA256_DSA: z.coerce.string().optional(), - SHA256_ECDSA: z.coerce.string().optional(), - SHA256_ED25519: z.coerce.string().optional(), - }) - .optional(), - ssh_keys: z.array(z.coerce.string()).optional(), - hooks: z.array(z.coerce.string()).optional(), - web: z.array(z.coerce.string()).optional(), - api: z.array(z.coerce.string()).optional(), - git: z.array(z.coerce.string()).optional(), - packages: z.array(z.coerce.string()).optional(), - pages: z.array(z.coerce.string()).optional(), - importer: z.array(z.coerce.string()).optional(), - actions: z.array(z.coerce.string()).optional(), - dependabot: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + verifiable_password_authentication: z.coerce.boolean(), + ssh_key_fingerprints: z + .object({ + SHA256_RSA: z.coerce.string().optional(), + SHA256_DSA: z.coerce.string().optional(), + SHA256_ECDSA: z.coerce.string().optional(), + SHA256_ED25519: z.coerce.string().optional(), + }) + .optional(), + ssh_keys: z.array(z.coerce.string()).optional(), + hooks: z.array(z.coerce.string()).optional(), + web: z.array(z.coerce.string()).optional(), + api: z.array(z.coerce.string()).optional(), + git: z.array(z.coerce.string()).optional(), + packages: z.array(z.coerce.string()).optional(), + pages: z.array(z.coerce.string()).optional(), + importer: z.array(z.coerce.string()).optional(), + actions: z.array(z.coerce.string()).optional(), + dependabot: z.array(z.coerce.string()).optional(), + }), + ], + ["304", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -16818,152 +20284,57 @@ export function bootstrap( const { status, body } = await implementation.activityListPublicEventsForRepoNetwork(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ id: z.coerce.number(), - node_id: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -16986,34 +20357,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17035,27 +20393,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17078,287 +20419,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + ) + .optional(), + milestone: z.object({ url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), + html_url: z.coerce.string(), labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17381,108 +20454,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17504,95 +20507,576 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -17626,231 +21110,235 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - subject: z.object({ - title: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), url: z.coerce.string(), - latest_comment_url: z.coerce.string(), - type: z.coerce.string(), - }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), - url: z.coerce.string(), - subscription_url: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + subscription_url: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -17879,30 +21367,32 @@ export function bootstrap( const { status, body } = await implementation.activityMarkNotificationsAsRead(input, ctx) - if (status === 202) { - ctx.body = z - .object({ message: z.coerce.string().optional() }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["202", z.object({ message: z.coerce.string().optional() })], + ["205", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -17927,206 +21417,210 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.string(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.string(), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), }), - subject: z.object({ - title: z.coerce.string(), - url: z.coerce.string(), - latest_comment_url: z.coerce.string(), - type: z.coerce.string(), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), - url: z.coerce.string(), - subscription_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18154,17 +21648,22 @@ export function bootstrap( ctx ) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["205", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18193,38 +21692,42 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - thread_url: z.coerce.string().optional(), - repository_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + thread_url: z.coerce.string().optional(), + repository_url: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18257,38 +21760,42 @@ export function bootstrap( const { status, body } = await implementation.activitySetThreadSubscription(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - thread_url: z.coerce.string().optional(), - repository_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + thread_url: z.coerce.string().optional(), + repository_url: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18314,26 +21821,31 @@ export function bootstrap( const { status, body } = await implementation.activityDeleteThreadSubscription(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18352,10 +21864,10 @@ export function bootstrap( const { status, body } = await implementation.metaGetOctocat(input, ctx) - if (status === 200) { - ctx.body = z.coerce.string().parse(body) - } - + ctx.body = responseValidationFactory( + [["200", z.coerce.string()]], + undefined + )(status, body) ctx.status = status return next() }) @@ -18374,27 +21886,31 @@ export function bootstrap( const { status, body } = await implementation.orgsList(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -18410,108 +21926,114 @@ export function bootstrap( const { status, body } = await implementation.orgsGet(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce.boolean().optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - advanced_security_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_alerts_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_security_updates_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependency_graph_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_custom_link_enabled: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_custom_link: z.coerce - .string() - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + advanced_security_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_alerts_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_security_updates_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependency_graph_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_enabled_for_new_repositories: + z.coerce.boolean().optional(), + secret_scanning_push_protection_custom_link_enabled: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link: z.coerce + .string() + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -18579,138 +22101,144 @@ export function bootstrap( const { status, body } = await implementation.orgsUpdate(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce.boolean().optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - advanced_security_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_alerts_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_security_updates_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependency_graph_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_custom_link_enabled: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_custom_link: z.coerce - .string() - .optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .union([ + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + advanced_security_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_alerts_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependabot_security_updates_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependency_graph_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_enabled_for_new_repositories: + z.coerce.boolean().optional(), + secret_scanning_push_protection_custom_link_enabled: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link: z.coerce + .string() .optional(), }), + ], + [ + "409", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - ]) - .parse(body) - } - + ], + [ + "422", + z.union([ + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ]), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -18735,15 +22263,18 @@ export function bootstrap( const { status, body } = await implementation.actionsGetActionsCacheUsageForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_active_caches_count: z.coerce.number(), - total_active_caches_size_in_bytes: z.coerce.number(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_active_caches_count: z.coerce.number(), + total_active_caches_size_in_bytes: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18777,21 +22308,24 @@ export function bootstrap( const { status, body } = await implementation.actionsGetActionsCacheUsageByRepoForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repository_cache_usages: z.array( - z.object({ - full_name: z.coerce.string(), - active_caches_size_in_bytes: z.coerce.number(), - active_caches_count: z.coerce.number(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repository_cache_usages: z.array( + z.object({ + full_name: z.coerce.string(), + active_caches_size_in_bytes: z.coerce.number(), + active_caches_count: z.coerce.number(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18817,12 +22351,10 @@ export function bootstrap( const { status, body } = await implementation.oidcGetOidcCustomSubTemplateForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ include_claim_keys: z.array(z.coerce.string()) }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [["200", z.object({ include_claim_keys: z.array(z.coerce.string()) })]], + undefined + )(status, body) ctx.status = status return next() } @@ -18855,28 +22387,30 @@ export function bootstrap( const { status, body } = await implementation.oidcUpdateOidcCustomSubTemplateForOrg(input, ctx) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18905,19 +22439,22 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - enabled_repositories: z.enum(["all", "none", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - allowed_actions: z - .enum(["all", "local_only", "selected"]) - .optional(), - selected_actions_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + enabled_repositories: z.enum(["all", "none", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + allowed_actions: z + .enum(["all", "local_only", "selected"]) + .optional(), + selected_actions_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -18954,6 +22491,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -18990,26 +22531,62 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -19031,274 +22608,241 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - }) - .parse(body) - } - + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -19332,6 +22876,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -19359,6 +22907,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -19386,6 +22938,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -19411,16 +22967,19 @@ export function bootstrap( const { status, body } = await implementation.actionsGetAllowedActionsOrganization(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + github_owned_allowed: z.coerce.boolean().optional(), + verified_allowed: z.coerce.boolean().optional(), + patterns_allowed: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -19457,6 +23016,10 @@ export function bootstrap( const { status, body } = await implementation.actionsSetAllowedActionsOrganization(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -19484,15 +23047,18 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - default_workflow_permissions: z.enum(["read", "write"]), - can_approve_pull_request_reviews: z.coerce.boolean(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + default_workflow_permissions: z.enum(["read", "write"]), + can_approve_pull_request_reviews: z.coerce.boolean(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -19531,6 +23097,13 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -19564,189 +23137,192 @@ export function bootstrap( const { status, body } = await implementation.actionsListRequiredWorkflows(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - required_workflows: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + required_workflows: z.array( + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }) - ), - }) - .parse(body) - } - + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -19782,192 +23358,195 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRequiredWorkflow(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -19996,514 +23575,242 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsUpdateRequiredWorkflowParamSchema = z.object({ - org: z.coerce.string(), - required_workflow_id: z.coerce.number(), - }) - - const actionsUpdateRequiredWorkflowBodySchema = z.object({ - workflow_file_path: z.coerce.string().optional(), - repository_id: z.coerce.string().optional(), - scope: z.enum(["selected", "all"]).optional(), - selected_repository_ids: z.array(z.coerce.number()).optional(), - }) - - router.patch( - "actionsUpdateRequiredWorkflow", - "/orgs/:org/actions/required_workflows/:requiredWorkflowId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsUpdateRequiredWorkflowParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsUpdateRequiredWorkflowBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsUpdateRequiredWorkflow(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDeleteRequiredWorkflowParamSchema = z.object({ + const actionsUpdateRequiredWorkflowParamSchema = z.object({ org: z.coerce.string(), required_workflow_id: z.coerce.number(), }) - router.delete( - "actionsDeleteRequiredWorkflow", - "/orgs/:org/actions/required_workflows/:requiredWorkflowId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteRequiredWorkflowParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsDeleteRequiredWorkflow(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsListSelectedRepositoriesRequiredWorkflowParamSchema = z.object({ - org: z.coerce.string(), - required_workflow_id: z.coerce.number(), + const actionsUpdateRequiredWorkflowBodySchema = z.object({ + workflow_file_path: z.coerce.string().optional(), + repository_id: z.coerce.string().optional(), + scope: z.enum(["selected", "all"]).optional(), + selected_repository_ids: z.array(z.coerce.number()).optional(), }) - router.get( - "actionsListSelectedRepositoriesRequiredWorkflow", - "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", + router.patch( + "actionsUpdateRequiredWorkflow", + "/orgs/:org/actions/required_workflows/:requiredWorkflowId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListSelectedRepositoriesRequiredWorkflowParamSchema, + actionsUpdateRequiredWorkflowParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + actionsUpdateRequiredWorkflowBodySchema, + ctx.body + ), } const { status, body } = - await implementation.actionsListSelectedRepositoriesRequiredWorkflow( - input, - ctx - ) + await implementation.actionsUpdateRequiredWorkflow(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -20549,7 +23856,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -20561,7 +23868,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -20569,197 +23876,483 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z + secret_scanning: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - }) - .parse(body) + }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteRequiredWorkflowParamSchema = z.object({ + org: z.coerce.string(), + required_workflow_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteRequiredWorkflow", + "/orgs/:org/actions/required_workflows/:requiredWorkflowId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteRequiredWorkflowParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteRequiredWorkflow(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsListSelectedRepositoriesRequiredWorkflowParamSchema = z.object({ + org: z.coerce.string(), + required_workflow_id: z.coerce.number(), + }) + + router.get( + "actionsListSelectedRepositoriesRequiredWorkflow", + "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListSelectedRepositoriesRequiredWorkflowParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.actionsListSelectedRepositoriesRequiredWorkflow( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }), + ], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -20796,6 +24389,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -20826,6 +24423,14 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -20856,6 +24461,14 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -20890,32 +24503,37 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnerGroupsForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - runner_groups: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce - .boolean() - .optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runner_groups: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce + .boolean() + .optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce + .boolean() + .optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -20957,25 +24575,30 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce.boolean().optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce + .boolean() + .optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21002,25 +24625,30 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerGroupForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce.boolean().optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce + .boolean() + .optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21061,25 +24689,30 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce.boolean().optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce + .boolean() + .optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21109,6 +24742,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -21147,178 +24784,181 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21355,6 +24995,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -21386,6 +25030,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -21423,30 +25071,33 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21483,6 +25134,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -21510,6 +25165,10 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelfHostedRunnerToGroupForOrg(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -21540,6 +25199,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -21573,30 +25236,33 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnersForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21622,21 +25288,24 @@ export function bootstrap( const { status, body } = await implementation.actionsListRunnerApplicationsForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - os: z.coerce.string(), - architecture: z.coerce.string(), - download_url: z.coerce.string(), - filename: z.coerce.string(), - temp_download_token: z.coerce.string().optional(), - sha256_checksum: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -21662,29 +25331,65 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRegistrationTokenForOrg(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -21706,277 +25411,246 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }) - .parse(body) - } - + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22002,29 +25676,65 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRemoveTokenForOrg(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -22046,277 +25756,246 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }) - .parse(body) - } - + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22343,33 +26022,36 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDeleteSelfHostedRunnerFromOrgParamSchema = z.object({ - org: z.coerce.string(), - runner_id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteSelfHostedRunnerFromOrgParamSchema = z.object({ + org: z.coerce.string(), + runner_id: z.coerce.number(), }) router.delete( @@ -22388,6 +26070,10 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteSelfHostedRunnerFromOrg(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -22417,30 +26103,33 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22477,38 +26166,41 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22545,38 +26237,41 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22604,30 +26299,33 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22659,38 +26357,41 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22718,23 +26419,26 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22760,19 +26464,22 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22798,18 +26505,21 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22846,10 +26556,13 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateOrgSecret(input, ctx) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -22878,6 +26591,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -22912,284 +26629,305 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelectedReposForOrgSecret(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetSelectedReposForOrgSecretParamSchema = z.object({ - org: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const actionsSetSelectedReposForOrgSecretBodySchema = z.object({ - selected_repository_ids: z.array(z.coerce.number()), - }) - - router.put( - "actionsSetSelectedReposForOrgSecret", - "/orgs/:org/actions/secrets/:secretName/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetSelectedReposForOrgSecretParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetSelectedReposForOrgSecretBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetSelectedReposForOrgSecret(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsAddSelectedRepoToOrgSecretParamSchema = z.object({ - org: z.coerce.string(), - secret_name: z.coerce.string(), - repository_id: z.coerce.number(), - }) - - router.put( - "actionsAddSelectedRepoToOrgSecret", - "/orgs/:org/actions/secrets/:secretName/repositories/:repositoryId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsAddSelectedRepoToOrgSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsAddSelectedRepoToOrgSecret(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsRemoveSelectedRepoFromOrgSecretParamSchema = z.object({ - org: z.coerce.string(), - secret_name: z.coerce.string(), - repository_id: z.coerce.number(), - }) - - router.delete( - "actionsRemoveSelectedRepoFromOrgSecret", - "/orgs/:org/actions/secrets/:secretName/repositories/:repositoryId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsRemoveSelectedRepoFromOrgSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsRemoveSelectedRepoFromOrgSecret(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsListOrgVariablesParamSchema = z.object({ - org: z.coerce.string(), - }) - - const actionsListOrgVariablesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "actionsListOrgVariables", - "/orgs/:org/actions/variables", - async (ctx, next) => { - const input = { + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetSelectedReposForOrgSecretParamSchema = z.object({ + org: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const actionsSetSelectedReposForOrgSecretBodySchema = z.object({ + selected_repository_ids: z.array(z.coerce.number()), + }) + + router.put( + "actionsSetSelectedReposForOrgSecret", + "/orgs/:org/actions/secrets/:secretName/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetSelectedReposForOrgSecretParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetSelectedReposForOrgSecretBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetSelectedReposForOrgSecret(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsAddSelectedRepoToOrgSecretParamSchema = z.object({ + org: z.coerce.string(), + secret_name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.put( + "actionsAddSelectedRepoToOrgSecret", + "/orgs/:org/actions/secrets/:secretName/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsAddSelectedRepoToOrgSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsAddSelectedRepoToOrgSecret(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsRemoveSelectedRepoFromOrgSecretParamSchema = z.object({ + org: z.coerce.string(), + secret_name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.delete( + "actionsRemoveSelectedRepoFromOrgSecret", + "/orgs/:org/actions/secrets/:secretName/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsRemoveSelectedRepoFromOrgSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsRemoveSelectedRepoFromOrgSecret(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsListOrgVariablesParamSchema = z.object({ + org: z.coerce.string(), + }) + + const actionsListOrgVariablesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListOrgVariables", + "/orgs/:org/actions/variables", + async (ctx, next) => { + const input = { params: parseRequestInput( actionsListOrgVariablesParamSchema, ctx.params @@ -23203,24 +26941,27 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -23255,10 +26996,10 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -23284,19 +27025,22 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -23332,6 +27076,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -23360,6 +27108,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -23394,223 +27146,234 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelectedReposForOrgVariable(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetSelectedReposForOrgVariableParamSchema = z.object({ - org: z.coerce.string(), - name: z.coerce.string(), - }) - - const actionsSetSelectedReposForOrgVariableBodySchema = z.object({ - selected_repository_ids: z.array(z.coerce.number()), - }) - - router.put( - "actionsSetSelectedReposForOrgVariable", - "/orgs/:org/actions/variables/:name/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetSelectedReposForOrgVariableParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetSelectedReposForOrgVariableBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetSelectedReposForOrgVariable(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsAddSelectedRepoToOrgVariableParamSchema = z.object({ - org: z.coerce.string(), - name: z.coerce.string(), - repository_id: z.coerce.number(), - }) - - router.put( + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetSelectedReposForOrgVariableParamSchema = z.object({ + org: z.coerce.string(), + name: z.coerce.string(), + }) + + const actionsSetSelectedReposForOrgVariableBodySchema = z.object({ + selected_repository_ids: z.array(z.coerce.number()), + }) + + router.put( + "actionsSetSelectedReposForOrgVariable", + "/orgs/:org/actions/variables/:name/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetSelectedReposForOrgVariableParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetSelectedReposForOrgVariableBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetSelectedReposForOrgVariable(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsAddSelectedRepoToOrgVariableParamSchema = z.object({ + org: z.coerce.string(), + name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.put( "actionsAddSelectedRepoToOrgVariable", "/orgs/:org/actions/variables/:name/repositories/:repositoryId", async (ctx, next) => { @@ -23626,6 +27389,13 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelectedRepoToOrgVariable(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -23656,6 +27426,13 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -23680,36 +27457,39 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -23734,17 +27514,21 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -23767,31 +27551,35 @@ export function bootstrap( const { status, body } = await implementation.orgsBlockUser(input, ctx) - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -23814,6 +27602,10 @@ export function bootstrap( const { status, body } = await implementation.orgsUnblockUser(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -23857,104 +27649,27 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListAlertsForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce.string().datetime({ offset: true }).optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - severity: z - .enum(["none", "note", "warning", "error"]) - .optional(), - security_severity_level: z - .enum(["low", "medium", "high", "critical"]) - .optional(), - description: z.coerce.string().optional(), - full_description: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - help: z.coerce.string().optional(), - help_uri: z.coerce.string().optional(), - }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + dismissed_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -23977,158 +27692,59 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesListInOrganizationParamSchema = z.object({ - org: z.coerce.string(), - }) - - const codespacesListInOrganizationQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "codespacesListInOrganization", - "/orgs/:org/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesListInOrganizationParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListInOrganizationQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesListInOrganization(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), }), - billable_owner: z.object({ + tool: z.object({ name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), }), repository: z.object({ id: z.coerce.number(), @@ -24180,7 +27796,6 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -24192,7 +27807,6 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -24200,215 +27814,405 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesListInOrganizationParamSchema = z.object({ + org: z.coerce.string(), + }) + + const codespacesListInOrganizationQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "codespacesListInOrganization", + "/orgs/:org/codespaces", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesListInOrganizationParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesListInOrganizationQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesListInOrganization(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + allowed_port_privacy_settings: z + .array(z.coerce.string()) .optional(), }) .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce + .string() + .optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24447,49 +28251,55 @@ export function bootstrap( const { status, body } = await implementation.codespacesSetCodespacesBilling(input, ctx) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["400", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24525,23 +28335,26 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24569,19 +28382,22 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24610,18 +28426,21 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24658,42 +28477,45 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateOrUpdateOrgSecret(input, ctx) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24722,17 +28544,21 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24767,187 +28593,190 @@ export function bootstrap( const { status, body } = await implementation.codespacesListSelectedReposForOrgSecret(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -24981,17 +28810,22 @@ export function bootstrap( const { status, body } = await implementation.codespacesSetSelectedReposForOrgSecret(input, ctx) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25019,40 +28853,45 @@ export function bootstrap( const { status, body } = await implementation.codespacesAddSelectedRepoToOrgSecret(input, ctx) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["409", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25083,40 +28922,45 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["409", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25162,116 +29006,81 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ ecosystem: z.coerce.string(), name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -25294,90 +29103,129 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ), + ], + ["304", z.void()], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25413,23 +29261,26 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25457,12 +29308,15 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ key_id: z.coerce.string(), key: z.coerce.string() }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ key_id: z.coerce.string(), key: z.coerce.string() }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25491,18 +29345,21 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25539,10 +29396,13 @@ export function bootstrap( const { status, body } = await implementation.dependabotCreateOrUpdateOrgSecret(input, ctx) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25571,6 +29431,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -25605,178 +29469,181 @@ export function bootstrap( const { status, body } = await implementation.dependabotListSelectedReposForOrgSecret(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25810,6 +29677,10 @@ export function bootstrap( const { status, body } = await implementation.dependabotSetSelectedReposForOrgSecret(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -25837,6 +29708,13 @@ export function bootstrap( const { status, body } = await implementation.dependabotAddSelectedRepoToOrgSecret(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25867,6 +29745,13 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -25902,152 +29787,57 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ id: z.coerce.number(), - node_id: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26070,34 +29860,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26119,27 +29896,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26162,18 +29922,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26196,253 +29957,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26464,192 +30010,548 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -26685,58 +30587,61 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -26758,40 +30663,43 @@ export function bootstrap( const { status, body } = await implementation.orgsListWebhooks(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }) + ), + ], + [ + "404", z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ - url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -26821,61 +30729,64 @@ export function bootstrap( const { status, body } = await implementation.orgsCreateWebhook(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -26897,38 +30808,41 @@ export function bootstrap( const { status, body } = await implementation.orgsGetWebhook(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -26970,61 +30884,64 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27050,17 +30967,21 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27089,17 +31010,20 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27138,17 +31062,20 @@ export function bootstrap( const { status, body } = await implementation.orgsUpdateWebhookConfigForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27186,60 +31113,63 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), + ], + [ + "400", z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27269,64 +31199,70 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - url: z.coerce.string().optional(), - request: z.object({ headers: z.object({}), payload: z.object({}) }), - response: z.object({ - headers: z.object({}), - payload: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ + headers: z.object({}), + payload: z.object({}), + }), + response: z.object({ + headers: z.object({}), + payload: z.coerce.string(), + }), }), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27354,44 +31290,46 @@ export function bootstrap( const { status, body } = await implementation.orgsRedeliverWebhookDelivery(input, ctx) - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27414,17 +31352,21 @@ export function bootstrap( const { status, body } = await implementation.orgsPingWebhook(input, ctx) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27450,99 +31392,106 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z.enum(["read", "write"]).optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z.enum(["read", "write"]).optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27578,110 +31527,115 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - installations: z.array( - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + installations: z.array( + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } - + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z + .enum(["read", "write"]) + .optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27707,10 +31661,10 @@ export function bootstrap( const { status, body } = await implementation.interactionsGetRestrictionsForOrg(input, ctx) - if (status === 200) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -27750,43 +31704,46 @@ export function bootstrap( const { status, body } = await implementation.interactionsSetRestrictionsForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - origin: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -27812,6 +31769,10 @@ export function bootstrap( const { status, body } = await implementation.interactionsRemoveRestrictionsForOrg(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -27847,9 +31808,96 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsCreateInvitationParamSchema = z.object({ org: z.coerce.string() }) + + const orgsCreateInvitationBodySchema = z + .object({ + invitee_id: z.coerce.number().optional(), + email: z.coerce.string().optional(), + role: z.enum(["admin", "direct_member", "billing_manager"]).optional(), + team_ids: z.array(z.coerce.number()).optional(), + }) + .optional() + + router.post( + "orgsCreateInvitation", + "/orgs/:org/invitations", + async (ctx, next) => { + const input = { + params: parseRequestInput(orgsCreateInvitationParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(orgsCreateInvitationBodySchema, ctx.body), + } + + const { status, body } = await implementation.orgsCreateInvitation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ id: z.coerce.number(), login: z.coerce.string(), @@ -27885,133 +31933,52 @@ export function bootstrap( node_id: z.coerce.string(), invitation_teams_url: z.coerce.string(), invitation_source: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsCreateInvitationParamSchema = z.object({ org: z.coerce.string() }) - - const orgsCreateInvitationBodySchema = z - .object({ - invitee_id: z.coerce.number().optional(), - email: z.coerce.string().optional(), - role: z.enum(["admin", "direct_member", "billing_manager"]).optional(), - team_ids: z.array(z.coerce.number()).optional(), - }) - .optional() - - router.post( - "orgsCreateInvitation", - "/orgs/:org/invitations", - async (ctx, next) => { - const input = { - params: parseRequestInput(orgsCreateInvitationParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(orgsCreateInvitationBodySchema, ctx.body), - } - - const { status, body } = await implementation.orgsCreateInvitation( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const orgsCancelInvitationParamSchema = z.object({ - org: z.coerce.string(), - invitation_id: z.coerce.number(), - }) + const orgsCancelInvitationParamSchema = z.object({ + org: z.coerce.string(), + invitation_id: z.coerce.number(), + }) router.delete( "orgsCancelInvitation", @@ -28028,40 +31995,44 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -28095,58 +32066,61 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), name: z.coerce.string(), + slug: z.coerce.string(), description: z.coerce.string(), - permission: z.coerce.string(), privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), html_url: z.coerce.string(), + members_url: z.coerce.string(), repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -28176,123 +32150,28 @@ export function bootstrap( const { status, body } = await implementation.issuesListForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -28315,34 +32194,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -28364,27 +32230,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -28407,18 +32256,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -28441,525 +32291,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const orgsListMembersParamSchema = z.object({ org: z.coerce.string() }) - - const orgsListMembersQuerySchema = z.object({ - filter: z.enum(["2fa_disabled", "all"]).optional(), - role: z.enum(["all", "admin", "member"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("orgsListMembers", "/orgs/:org/members", async (ctx, next) => { - const input = { - params: parseRequestInput(orgsListMembersParamSchema, ctx.params), - query: parseRequestInput(orgsListMembersQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.orgsListMembers(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const orgsCheckMembershipForUserParamSchema = z.object({ - org: z.coerce.string(), - username: z.coerce.string(), - }) - - router.get( - "orgsCheckMembershipForUser", - "/orgs/:org/members/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsCheckMembershipForUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.orgsCheckMembershipForUser( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const orgsRemoveMemberParamSchema = z.object({ - org: z.coerce.string(), - username: z.coerce.string(), - }) - - router.delete( - "orgsRemoveMember", - "/orgs/:org/members/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput(orgsRemoveMemberParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.orgsRemoveMember(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesGetCodespacesForUserInOrgParamSchema = z.object({ - org: z.coerce.string(), - username: z.coerce.string(), - }) - - const codespacesGetCodespacesForUserInOrgQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "codespacesGetCodespacesForUserInOrg", - "/orgs/:org/members/:username/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesGetCodespacesForUserInOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesGetCodespacesForUserInOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesGetCodespacesForUserInOrg(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + patch_url: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -28981,12 +32340,60 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -29032,7 +32439,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), + git_url: z.coerce.string(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -29044,7 +32451,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), + ssh_url: z.coerce.string(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -29052,929 +32459,1389 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), + id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) .optional(), - secret_scanning: z + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), - }), - machine: z.object({ + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - ctx.status = status - return next() + const orgsListMembersParamSchema = z.object({ org: z.coerce.string() }) + + const orgsListMembersQuerySchema = z.object({ + filter: z.enum(["2fa_disabled", "all"]).optional(), + role: z.enum(["all", "admin", "member"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("orgsListMembers", "/orgs/:org/members", async (ctx, next) => { + const input = { + params: parseRequestInput(orgsListMembersParamSchema, ctx.params), + query: parseRequestInput(orgsListMembersQuerySchema, ctx.query), + body: undefined, } - ) - const codespacesDeleteFromOrganizationParamSchema = z.object({ + const { status, body } = await implementation.orgsListMembers(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const orgsCheckMembershipForUserParamSchema = z.object({ org: z.coerce.string(), username: z.coerce.string(), - codespace_name: z.coerce.string(), }) - router.delete( - "codespacesDeleteFromOrganization", - "/orgs/:org/members/:username/codespaces/:codespaceName", + router.get( + "orgsCheckMembershipForUser", + "/orgs/:org/members/:username", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesDeleteFromOrganizationParamSchema, + orgsCheckMembershipForUserParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesDeleteFromOrganization(input, ctx) + const { status, body } = await implementation.orgsCheckMembershipForUser( + input, + ctx + ) - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["302", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsRemoveMemberParamSchema = z.object({ + org: z.coerce.string(), + username: z.coerce.string(), + }) + + router.delete( + "orgsRemoveMember", + "/orgs/:org/members/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput(orgsRemoveMemberParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.orgsRemoveMember(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesStopInOrganizationParamSchema = z.object({ + const codespacesGetCodespacesForUserInOrgParamSchema = z.object({ org: z.coerce.string(), username: z.coerce.string(), - codespace_name: z.coerce.string(), }) - router.post( - "codespacesStopInOrganization", - "/orgs/:org/members/:username/codespaces/:codespaceName/stop", + const codespacesGetCodespacesForUserInOrgQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "codespacesGetCodespacesForUserInOrg", + "/orgs/:org/members/:username/codespaces", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesStopInOrganizationParamSchema, + codespacesGetCodespacesForUserInOrgParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + codespacesGetCodespacesForUserInOrgQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.codespacesStopInOrganization(input, ctx) + await implementation.codespacesGetCodespacesForUserInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), }) .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce + .string() .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), + last_known_stop_notice: z.coerce.string().optional(), }) - .optional(), + ), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsGetMembershipForUserParamSchema = z.object({ + const codespacesDeleteFromOrganizationParamSchema = z.object({ org: z.coerce.string(), username: z.coerce.string(), + codespace_name: z.coerce.string(), }) - router.get( - "orgsGetMembershipForUser", - "/orgs/:org/memberships/:username", + router.delete( + "codespacesDeleteFromOrganization", + "/orgs/:org/members/:username/codespaces/:codespaceName", async (ctx, next) => { const input = { params: parseRequestInput( - orgsGetMembershipForUserParamSchema, + codespacesDeleteFromOrganizationParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.orgsGetMembershipForUser( - input, - ctx - ) + const { status, body } = + await implementation.codespacesDeleteFromOrganization(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsSetMembershipForUserParamSchema = z.object({ + const codespacesStopInOrganizationParamSchema = z.object({ org: z.coerce.string(), username: z.coerce.string(), + codespace_name: z.coerce.string(), }) - const orgsSetMembershipForUserBodySchema = z - .object({ role: z.enum(["admin", "member"]).optional() }) - .optional() - - router.put( - "orgsSetMembershipForUser", - "/orgs/:org/memberships/:username", + router.post( + "codespacesStopInOrganization", + "/orgs/:org/members/:username/codespaces/:codespaceName/stop", async (ctx, next) => { const input = { params: parseRequestInput( - orgsSetMembershipForUserParamSchema, + codespacesStopInOrganizationParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(orgsSetMembershipForUserBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.orgsSetMembershipForUser( - input, - ctx - ) + const { status, body } = + await implementation.codespacesStopInOrganization(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsRemoveMembershipForUserParamSchema = z.object({ + const orgsGetMembershipForUserParamSchema = z.object({ org: z.coerce.string(), username: z.coerce.string(), }) - router.delete( - "orgsRemoveMembershipForUser", + router.get( + "orgsGetMembershipForUser", "/orgs/:org/memberships/:username", async (ctx, next) => { const input = { params: parseRequestInput( - orgsRemoveMembershipForUserParamSchema, + orgsGetMembershipForUserParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.orgsRemoveMembershipForUser( + const { status, body } = await implementation.orgsGetMembershipForUser( input, ctx ) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsListForOrgParamSchema = z.object({ org: z.coerce.string() }) - - const migrationsListForOrgQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - exclude: z.array(z.enum(["repositories"])).optional(), + const orgsSetMembershipForUserParamSchema = z.object({ + org: z.coerce.string(), + username: z.coerce.string(), }) - router.get( - "migrationsListForOrg", - "/orgs/:org/migrations", + const orgsSetMembershipForUserBodySchema = z + .object({ role: z.enum(["admin", "member"]).optional() }) + .optional() + + router.put( + "orgsSetMembershipForUser", + "/orgs/:org/memberships/:username", async (ctx, next) => { const input = { - params: parseRequestInput(migrationsListForOrgParamSchema, ctx.params), - query: parseRequestInput(migrationsListForOrgQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput( + orgsSetMembershipForUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(orgsSetMembershipForUserBodySchema, ctx.body), } - const { status, body } = await implementation.migrationsListForOrg( + const { status, body } = await implementation.orgsSetMembershipForUser( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - owner: z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -29997,446 +33864,133 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - ) - .parse(body) + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsRemoveMembershipForUserParamSchema = z.object({ + org: z.coerce.string(), + username: z.coerce.string(), + }) + + router.delete( + "orgsRemoveMembershipForUser", + "/orgs/:org/memberships/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsRemoveMembershipForUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = await implementation.orgsRemoveMembershipForUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsStartForOrgParamSchema = z.object({ org: z.coerce.string() }) + const migrationsListForOrgParamSchema = z.object({ org: z.coerce.string() }) - const migrationsStartForOrgBodySchema = z.object({ - repositories: z.array(z.coerce.string()), - lock_repositories: z.coerce.boolean().optional(), - exclude_metadata: z.coerce.boolean().optional(), - exclude_git_data: z.coerce.boolean().optional(), - exclude_attachments: z.coerce.boolean().optional(), - exclude_releases: z.coerce.boolean().optional(), - exclude_owner_projects: z.coerce.boolean().optional(), - org_metadata_only: z.coerce.boolean().optional(), + const migrationsListForOrgQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), exclude: z.array(z.enum(["repositories"])).optional(), }) - router.post( - "migrationsStartForOrg", + router.get( + "migrationsListForOrg", "/orgs/:org/migrations", async (ctx, next) => { const input = { - params: parseRequestInput(migrationsStartForOrgParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(migrationsStartForOrgBodySchema, ctx.body), + params: parseRequestInput(migrationsListForOrgParamSchema, ctx.params), + query: parseRequestInput(migrationsListForOrgQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.migrationsStartForOrg( + const { status, body } = await implementation.migrationsListForOrg( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -30460,180 +34014,286 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), permissions: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -30655,473 +34315,839 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), }) ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsGetStatusForOrgParamSchema = z.object({ - org: z.coerce.string(), - migration_id: z.coerce.number(), - }) + const migrationsStartForOrgParamSchema = z.object({ org: z.coerce.string() }) - const migrationsGetStatusForOrgQuerySchema = z.object({ + const migrationsStartForOrgBodySchema = z.object({ + repositories: z.array(z.coerce.string()), + lock_repositories: z.coerce.boolean().optional(), + exclude_metadata: z.coerce.boolean().optional(), + exclude_git_data: z.coerce.boolean().optional(), + exclude_attachments: z.coerce.boolean().optional(), + exclude_releases: z.coerce.boolean().optional(), + exclude_owner_projects: z.coerce.boolean().optional(), + org_metadata_only: z.coerce.boolean().optional(), exclude: z.array(z.enum(["repositories"])).optional(), }) - router.get( - "migrationsGetStatusForOrg", - "/orgs/:org/migrations/:migrationId", + router.post( + "migrationsStartForOrg", + "/orgs/:org/migrations", async (ctx, next) => { const input = { - params: parseRequestInput( - migrationsGetStatusForOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - migrationsGetStatusForOrgQuerySchema, - ctx.query - ), - body: undefined, + params: parseRequestInput(migrationsStartForOrgParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(migrationsStartForOrgBodySchema, ctx.body), } - const { status, body } = await implementation.migrationsGetStatusForOrg( + const { status, body } = await implementation.migrationsStartForOrg( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetStatusForOrgParamSchema = z.object({ + org: z.coerce.string(), + migration_id: z.coerce.number(), + }) + + const migrationsGetStatusForOrgQuerySchema = z.object({ + exclude: z.array(z.enum(["repositories"])).optional(), + }) + + router.get( + "migrationsGetStatusForOrg", + "/orgs/:org/migrations/:migrationId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsGetStatusForOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + migrationsGetStatusForOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.migrationsGetStatusForOrg( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31148,17 +35174,21 @@ export function bootstrap( const { status, body } = await implementation.migrationsDownloadArchiveForOrg(input, ctx) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["302", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31185,17 +35215,21 @@ export function bootstrap( const { status, body } = await implementation.migrationsDeleteArchiveForOrg(input, ctx) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31225,17 +35259,21 @@ export function bootstrap( ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31272,184 +35310,187 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31484,36 +35525,39 @@ export function bootstrap( const { status, body } = await implementation.orgsListOutsideCollaborators(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31547,19 +35591,23 @@ export function bootstrap( const { status, body } = await implementation.orgsConvertMemberToOutsideCollaborator(input, ctx) - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + ["204", z.void()], + ["403", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31586,15 +35634,19 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveOutsideCollaborator(input, ctx) - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -31635,56 +35687,28 @@ export function bootstrap( const { status, body } = await implementation.packagesListPackagesForOrganization(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -31706,79 +35730,377 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const packagesGetPackageForOrganizationParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + org: z.coerce.string(), + }) + + router.get( + "packagesGetPackageForOrganization", + "/orgs/:org/packages/:packageType/:packageName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesGetPackageForOrganizationParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.packagesGetPackageForOrganization(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), updated_at: z.coerce .string() @@ -31844,35 +36166,86 @@ export function bootstrap( .optional(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const packagesDeletePackageForOrgParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + org: z.coerce.string(), + }) + + router.delete( + "packagesDeletePackageForOrg", + "/orgs/:org/packages/:packageType/:packageName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesDeletePackageForOrgParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = await implementation.packagesDeletePackageForOrg( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const packagesGetPackageForOrganizationParamSchema = z.object({ + const packagesRestorePackageForOrgParamSchema = z.object({ package_type: z.enum([ "npm", "maven", @@ -31885,305 +36258,188 @@ export function bootstrap( org: z.coerce.string(), }) + const packagesRestorePackageForOrgQuerySchema = z.object({ + token: z.coerce.string().optional(), + }) + + router.post( + "packagesRestorePackageForOrg", + "/orgs/:org/packages/:packageType/:packageName/restore", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesRestorePackageForOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + packagesRestorePackageForOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.packagesRestorePackageForOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const packagesGetAllPackageVersionsForPackageOwnedByOrgParamSchema = z.object( + { + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + org: z.coerce.string(), + } + ) + + const packagesGetAllPackageVersionsForPackageOwnedByOrgQuerySchema = z.object( + { + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + state: z.enum(["active", "deleted"]).optional(), + } + ) + router.get( - "packagesGetPackageForOrganization", - "/orgs/:org/packages/:packageType/:packageName", + "packagesGetAllPackageVersionsForPackageOwnedByOrg", + "/orgs/:org/packages/:packageType/:packageName/versions", async (ctx, next) => { const input = { params: parseRequestInput( - packagesGetPackageForOrganizationParamSchema, + packagesGetAllPackageVersionsForPackageOwnedByOrgParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + packagesGetAllPackageVersionsForPackageOwnedByOrgQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.packagesGetPackageForOrganization(input, ctx) + await implementation.packagesGetAllPackageVersionsForPackageOwnedByOrg( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce .string() .datetime({ offset: true }) .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + metadata: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) .optional(), }) .optional(), }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const packagesDeletePackageForOrgParamSchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), - org: z.coerce.string(), - }) - - router.delete( - "packagesDeletePackageForOrg", - "/orgs/:org/packages/:packageType/:packageName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - packagesDeletePackageForOrgParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.packagesDeletePackageForOrg( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const packagesRestorePackageForOrgParamSchema = z.object({ + const packagesGetPackageVersionForOrganizationParamSchema = z.object({ package_type: z.enum([ "npm", "maven", @@ -32194,113 +36450,32 @@ export function bootstrap( ]), package_name: z.coerce.string(), org: z.coerce.string(), + package_version_id: z.coerce.number(), }) - const packagesRestorePackageForOrgQuerySchema = z.object({ - token: z.coerce.string().optional(), - }) - - router.post( - "packagesRestorePackageForOrg", - "/orgs/:org/packages/:packageType/:packageName/restore", - async (ctx, next) => { - const input = { - params: parseRequestInput( - packagesRestorePackageForOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - packagesRestorePackageForOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.packagesRestorePackageForOrg(input, ctx) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const packagesGetAllPackageVersionsForPackageOwnedByOrgParamSchema = z.object( - { - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), - org: z.coerce.string(), - } - ) - - const packagesGetAllPackageVersionsForPackageOwnedByOrgQuerySchema = z.object( - { - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - state: z.enum(["active", "deleted"]).optional(), - } - ) - router.get( - "packagesGetAllPackageVersionsForPackageOwnedByOrg", - "/orgs/:org/packages/:packageType/:packageName/versions", + "packagesGetPackageVersionForOrganization", + "/orgs/:org/packages/:packageType/:packageName/versions/:packageVersionId", async (ctx, next) => { const input = { params: parseRequestInput( - packagesGetAllPackageVersionsForPackageOwnedByOrgParamSchema, + packagesGetPackageVersionForOrganizationParamSchema, ctx.params ), - query: parseRequestInput( - packagesGetAllPackageVersionsForPackageOwnedByOrgQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } const { status, body } = - await implementation.packagesGetAllPackageVersionsForPackageOwnedByOrg( + await implementation.packagesGetPackageVersionForOrganization( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), name: z.coerce.string(), @@ -32333,111 +36508,11 @@ export function bootstrap( .optional(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const packagesGetPackageVersionForOrganizationParamSchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), - org: z.coerce.string(), - package_version_id: z.coerce.number(), - }) - - router.get( - "packagesGetPackageVersionForOrganization", - "/orgs/:org/packages/:packageType/:packageName/versions/:packageVersionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - packagesGetPackageVersionForOrganizationParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.packagesGetPackageVersionForOrganization( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce.string().datetime({ offset: true }).optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32473,35 +36548,39 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageVersionForOrg(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32537,35 +36616,39 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageVersionForOrg(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32588,81 +36671,84 @@ export function bootstrap( const { status, body } = await implementation.projectsListForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const projectsCreateForOrgParamSchema = z.object({ org: z.coerce.string() }) - - const projectsCreateForOrgBodySchema = z.object({ - name: z.coerce.string(), - body: z.coerce.string().optional(), - }) - - router.post( - "projectsCreateForOrg", - "/orgs/:org/projects", - async (ctx, next) => { - const input = { - params: parseRequestInput(projectsCreateForOrgParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(projectsCreateForOrgBodySchema, ctx.body), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const projectsCreateForOrgParamSchema = z.object({ org: z.coerce.string() }) + + const projectsCreateForOrgBodySchema = z.object({ + name: z.coerce.string(), + body: z.coerce.string().optional(), + }) + + router.post( + "projectsCreateForOrg", + "/orgs/:org/projects", + async (ctx, next) => { + const input = { + params: parseRequestInput(projectsCreateForOrgParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(projectsCreateForOrgBodySchema, ctx.body), } const { status, body } = await implementation.projectsCreateForOrg( @@ -32670,96 +36756,99 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32787,36 +36876,39 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32843,6 +36935,13 @@ export function bootstrap( const { status, body } = await implementation.orgsCheckPublicMembershipForUser(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32872,17 +36971,21 @@ export function bootstrap( ctx ) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -32912,6 +37015,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -32938,14 +37045,276 @@ export function bootstrap( const { status, body } = await implementation.reposListForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposCreateInOrgParamSchema = z.object({ org: z.coerce.string() }) + + const reposCreateInOrgBodySchema = z.object({ + name: z.coerce.string(), + description: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + visibility: z.enum(["public", "private"]).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + team_id: z.coerce.number().optional(), + auto_init: z.coerce.boolean().optional(), + gitignore_template: z.coerce.string().optional(), + license_template: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + }) + + router.post("reposCreateInOrg", "/orgs/:org/repos", async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateInOrgParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateInOrgBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateInOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -32991,7 +37360,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), + git_url: z.coerce.string(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -33003,7 +37372,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), + ssh_url: z.coerce.string(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -33011,471 +37380,226 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }).optional(), - created_at: z.coerce.string().datetime({ offset: true }).optional(), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), + id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) .optional(), - secret_scanning: z + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - }) - - const reposCreateInOrgParamSchema = z.object({ org: z.coerce.string() }) - - const reposCreateInOrgBodySchema = z.object({ - name: z.coerce.string(), - description: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - visibility: z.enum(["public", "private"]).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - team_id: z.coerce.number().optional(), - auto_init: z.coerce.boolean().optional(), - gitignore_template: z.coerce.string().optional(), - license_template: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), - }) - - router.post("reposCreateInOrg", "/orgs/:org/repos", async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateInOrgParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateInOrgBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateInOrg(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -33515,84 +37639,53 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListAlertsForOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), subscriptions_url: z.coerce.string(), organizations_url: z.coerce.string(), repos_url: z.coerce.string(), @@ -33601,103 +37694,137 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }) - .optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolution_comment: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + }) + .optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }) + .optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -33723,27 +37850,30 @@ export function bootstrap( const { status, body } = await implementation.orgsListSecurityManagerTeams(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -33772,6 +37902,13 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -33798,6 +37935,10 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveSecurityManagerTeam(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -33823,33 +37964,36 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubActionsBillingOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_minutes_used: z.coerce.number(), - total_paid_minutes_used: z.coerce.number(), - included_minutes: z.coerce.number(), - minutes_used_breakdown: z.object({ - UBUNTU: z.coerce.number().optional(), - MACOS: z.coerce.number().optional(), - WINDOWS: z.coerce.number().optional(), - ubuntu_4_core: z.coerce.number().optional(), - ubuntu_8_core: z.coerce.number().optional(), - ubuntu_16_core: z.coerce.number().optional(), - ubuntu_32_core: z.coerce.number().optional(), - ubuntu_64_core: z.coerce.number().optional(), - windows_4_core: z.coerce.number().optional(), - windows_8_core: z.coerce.number().optional(), - windows_16_core: z.coerce.number().optional(), - windows_32_core: z.coerce.number().optional(), - windows_64_core: z.coerce.number().optional(), - macos_12_core: z.coerce.number().optional(), - total: z.coerce.number().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_minutes_used: z.coerce.number(), + total_paid_minutes_used: z.coerce.number(), + included_minutes: z.coerce.number(), + minutes_used_breakdown: z.object({ + UBUNTU: z.coerce.number().optional(), + MACOS: z.coerce.number().optional(), + WINDOWS: z.coerce.number().optional(), + ubuntu_4_core: z.coerce.number().optional(), + ubuntu_8_core: z.coerce.number().optional(), + ubuntu_16_core: z.coerce.number().optional(), + ubuntu_32_core: z.coerce.number().optional(), + ubuntu_64_core: z.coerce.number().optional(), + windows_4_core: z.coerce.number().optional(), + windows_8_core: z.coerce.number().optional(), + windows_16_core: z.coerce.number().optional(), + windows_32_core: z.coerce.number().optional(), + windows_64_core: z.coerce.number().optional(), + macos_12_core: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }), }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -33875,16 +38019,19 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubPackagesBillingOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_gigabytes_bandwidth_used: z.coerce.number(), - total_paid_gigabytes_bandwidth_used: z.coerce.number(), - included_gigabytes_bandwidth: z.coerce.number(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_gigabytes_bandwidth_used: z.coerce.number(), + total_paid_gigabytes_bandwidth_used: z.coerce.number(), + included_gigabytes_bandwidth: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -33910,16 +38057,19 @@ export function bootstrap( const { status, body } = await implementation.billingGetSharedStorageBillingOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - days_left_in_billing_cycle: z.coerce.number(), - estimated_paid_storage_for_month: z.coerce.number(), - estimated_storage_for_month: z.coerce.number(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + days_left_in_billing_cycle: z.coerce.number(), + estimated_paid_storage_for_month: z.coerce.number(), + estimated_storage_for_month: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -33941,58 +38091,61 @@ export function bootstrap( const { status, body } = await implementation.teamsList(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), name: z.coerce.string(), + slug: z.coerce.string(), description: z.coerce.string(), - permission: z.coerce.string(), privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), html_url: z.coerce.string(), + members_url: z.coerce.string(), repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -34018,169 +38171,11 @@ export function bootstrap( const { status, body } = await implementation.teamsCreate(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const teamsGetByNameParamSchema = z.object({ - org: z.coerce.string(), - team_slug: z.coerce.string(), - }) - - router.get( - "teamsGetByName", - "/orgs/:org/teams/:teamSlug", - async (ctx, next) => { - const input = { - params: parseRequestInput(teamsGetByNameParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsGetByName(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), @@ -34281,426 +38276,600 @@ export function bootstrap( updated_at: z.coerce.string().datetime({ offset: true }), }), ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const teamsUpdateInOrgParamSchema = z.object({ + const teamsGetByNameParamSchema = z.object({ org: z.coerce.string(), team_slug: z.coerce.string(), }) - const teamsUpdateInOrgBodySchema = z - .object({ - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.enum(["secret", "closed"]).optional(), - permission: z.enum(["pull", "push", "admin"]).optional(), - parent_team_id: z.coerce.number().optional(), - }) - .optional() - - router.patch( - "teamsUpdateInOrg", + router.get( + "teamsGetByName", "/orgs/:org/teams/:teamSlug", async (ctx, next) => { const input = { - params: parseRequestInput(teamsUpdateInOrgParamSchema, ctx.params), + params: parseRequestInput(teamsGetByNameParamSchema, ctx.params), query: undefined, - body: parseRequestInput(teamsUpdateInOrgBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.teamsUpdateInOrg(input, ctx) + const { status, body } = await implementation.teamsGetByName(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), }) .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ + organization: z.object({ + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), members_url: z.coerce.string(), - name: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), }), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsDeleteInOrgParamSchema = z.object({ + const teamsUpdateInOrgParamSchema = z.object({ org: z.coerce.string(), team_slug: z.coerce.string(), }) - router.delete( - "teamsDeleteInOrg", + const teamsUpdateInOrgBodySchema = z + .object({ + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.enum(["secret", "closed"]).optional(), + permission: z.enum(["pull", "push", "admin"]).optional(), + parent_team_id: z.coerce.number().optional(), + }) + .optional() + + router.patch( + "teamsUpdateInOrg", "/orgs/:org/teams/:teamSlug", async (ctx, next) => { const input = { - params: parseRequestInput(teamsDeleteInOrgParamSchema, ctx.params), + params: parseRequestInput(teamsUpdateInOrgParamSchema, ctx.params), query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsDeleteInOrg(input, ctx) - - ctx.status = status - return next() - } - ) - - const teamsListDiscussionsInOrgParamSchema = z.object({ - org: z.coerce.string(), - team_slug: z.coerce.string(), - }) - - const teamsListDiscussionsInOrgQuerySchema = z.object({ - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - pinned: z.coerce.string().optional(), - }) - - router.get( - "teamsListDiscussionsInOrg", - "/orgs/:org/teams/:teamSlug/discussions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsListDiscussionsInOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - teamsListDiscussionsInOrgQuerySchema, - ctx.query - ), - body: undefined, + body: parseRequestInput(teamsUpdateInOrgBodySchema, ctx.body), } - const { status, body } = await implementation.teamsListDiscussionsInOrg( - input, - ctx - ) + const { status, body } = await implementation.teamsUpdateInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), repos_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + ], + [ + "201", + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), }) .optional(), - }) - ) - .parse(body) + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsDeleteInOrgParamSchema = z.object({ + org: z.coerce.string(), + team_slug: z.coerce.string(), + }) + + router.delete( + "teamsDeleteInOrg", + "/orgs/:org/teams/:teamSlug", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsDeleteInOrgParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsDeleteInOrg(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const teamsListDiscussionsInOrgParamSchema = z.object({ + org: z.coerce.string(), + team_slug: z.coerce.string(), + }) + + const teamsListDiscussionsInOrgQuerySchema = z.object({ + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + pinned: z.coerce.string().optional(), + }) + + router.get( + "teamsListDiscussionsInOrg", + "/orgs/:org/teams/:teamSlug/discussions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsListDiscussionsInOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + teamsListDiscussionsInOrgQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = await implementation.teamsListDiscussionsInOrg( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -34735,66 +38904,69 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -34824,66 +38996,69 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -34920,66 +39095,69 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35009,6 +39187,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -35045,12 +39227,107 @@ export function bootstrap( const { status, body } = await implementation.teamsListDiscussionCommentsInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCreateDiscussionCommentInOrgParamSchema = z.object({ + org: z.coerce.string(), + team_slug: z.coerce.string(), + discussion_number: z.coerce.number(), + }) + + const teamsCreateDiscussionCommentInOrgBodySchema = z.object({ + body: z.coerce.string(), + }) + + router.post( + "teamsCreateDiscussionCommentInOrg", + "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCreateDiscussionCommentInOrgParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsCreateDiscussionCommentInOrgBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.teamsCreateDiscussionCommentInOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), id: z.coerce.number(), @@ -35097,100 +39374,11 @@ export function bootstrap( rocket: z.coerce.number(), }) .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsCreateDiscussionCommentInOrgParamSchema = z.object({ - org: z.coerce.string(), - team_slug: z.coerce.string(), - discussion_number: z.coerce.number(), - }) - - const teamsCreateDiscussionCommentInOrgBodySchema = z.object({ - body: z.coerce.string(), - }) - - router.post( - "teamsCreateDiscussionCommentInOrg", - "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsCreateDiscussionCommentInOrgParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsCreateDiscussionCommentInOrgBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.teamsCreateDiscussionCommentInOrg(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35219,61 +39407,64 @@ export function bootstrap( const { status, body } = await implementation.teamsGetDiscussionCommentInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35309,61 +39500,64 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateDiscussionCommentInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35392,6 +39586,10 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteDiscussionCommentInOrg(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -35443,51 +39641,54 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35535,90 +39736,93 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ], + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35648,6 +39852,10 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForTeamDiscussionComment(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -35695,51 +39903,54 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForTeamDiscussionInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35783,90 +39994,93 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForTeamDiscussionInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ], + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -35895,6 +40109,10 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForTeamDiscussion(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -35929,49 +40147,52 @@ export function bootstrap( const { status, body } = await implementation.teamsListPendingInvitationsInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36003,36 +40224,39 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36060,16 +40284,20 @@ export function bootstrap( const { status, body } = await implementation.teamsGetMembershipForUserInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }), + ], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36104,16 +40332,21 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateMembershipForUserInOrg(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }), + ], + ["403", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36141,6 +40374,13 @@ export function bootstrap( const { status, body } = await implementation.teamsRemoveMembershipForUserInOrg(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36174,9 +40414,91 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCheckPermissionsForProjectInOrgParamSchema = z.object({ + org: z.coerce.string(), + team_slug: z.coerce.string(), + project_id: z.coerce.number(), + }) + + router.get( + "teamsCheckPermissionsForProjectInOrg", + "/orgs/:org/teams/:teamSlug/projects/:projectId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCheckPermissionsForProjectInOrgParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.teamsCheckPermissionsForProjectInOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ owner_url: z.coerce.string(), url: z.coerce.string(), @@ -36220,87 +40542,12 @@ export function bootstrap( write: z.coerce.boolean(), admin: z.coerce.boolean(), }), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsCheckPermissionsForProjectInOrgParamSchema = z.object({ - org: z.coerce.string(), - team_slug: z.coerce.string(), - project_id: z.coerce.number(), - }) - - router.get( - "teamsCheckPermissionsForProjectInOrg", - "/orgs/:org/teams/:teamSlug/projects/:projectId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsCheckPermissionsForProjectInOrgParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.teamsCheckPermissionsForProjectInOrg(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), - }) - .parse(body) - } - + ], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36335,15 +40582,19 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateProjectPermissionsInOrg(input, ctx) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -36373,6 +40624,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -36403,23 +40658,243 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCheckPermissionsForRepoInOrgParamSchema = z.object({ + org: z.coerce.string(), + team_slug: z.coerce.string(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "teamsCheckPermissionsForRepoInOrg", + "/orgs/:org/teams/:teamSlug/repos/:owner/:repo", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCheckPermissionsForRepoInOrgParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.teamsCheckPermissionsForRepoInOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), followers_url: z.coerce.string(), following_url: z.coerce.string(), @@ -36456,7 +40931,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), + git_url: z.coerce.string(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -36468,7 +40943,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), + ssh_url: z.coerce.string(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -36476,263 +40951,82 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - key: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - secret_scanning_push_protection: z + forks: z.coerce.number(), + permissions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), - }) - .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsCheckPermissionsForRepoInOrgParamSchema = z.object({ - org: z.coerce.string(), - team_slug: z.coerce.string(), - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "teamsCheckPermissionsForRepoInOrg", - "/orgs/:org/teams/:teamSlug/repos/:owner/:repo", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsCheckPermissionsForRepoInOrgParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.teamsCheckPermissionsForRepoInOrg(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -36754,286 +41048,255 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - }) - .parse(body) - } - + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + }), + ], + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37069,6 +41332,10 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateRepoPermissionsInOrg(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -37096,6 +41363,10 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -37126,49 +41397,52 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), name: z.coerce.string(), + slug: z.coerce.string(), description: z.coerce.string(), - permission: z.coerce.string(), privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), html_url: z.coerce.string(), + members_url: z.coerce.string(), repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } - + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37206,6 +41480,13 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37225,75 +41506,79 @@ export function bootstrap( const { status, body } = await implementation.projectsGetCard(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37323,83 +41608,87 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37422,34 +41711,39 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37474,75 +41768,78 @@ export function bootstrap( const { status, body } = await implementation.projectsMoveCard(input, ctx) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z - .array( - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z - .array( - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37567,48 +41864,52 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37635,39 +41936,43 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37692,26 +41997,31 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37742,68 +42052,72 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37836,112 +42150,116 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .union([ + ], + ["304", z.void()], + [ + "401", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.union([ + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ]), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), errors: z .array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), + code: z.coerce.string().optional(), message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), }) ) .optional(), }), - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ]) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z - .array( - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -37968,36 +42286,39 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -38014,70 +42335,74 @@ export function bootstrap( const { status, body } = await implementation.projectsGet(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -38105,86 +42430,91 @@ export function bootstrap( const { status, body } = await implementation.projectsUpdate(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ["404", z.void()], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -38200,43 +42530,48 @@ export function bootstrap( const { status, body } = await implementation.projectsDelete(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -38272,100 +42607,104 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const projectsAddCollaboratorParamSchema = z.object({ - project_id: z.coerce.number(), - username: z.coerce.string(), - }) - - const projectsAddCollaboratorBodySchema = z - .object({ permission: z.enum(["read", "write", "admin"]).optional() }) - .optional() - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const projectsAddCollaboratorParamSchema = z.object({ + project_id: z.coerce.number(), + username: z.coerce.string(), + }) + + const projectsAddCollaboratorBodySchema = z + .object({ permission: z.enum(["read", "write", "admin"]).optional() }) + .optional() + router.put( "projectsAddCollaborator", "/projects/:projectId/collaborators/:username", @@ -38384,58 +42723,63 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -38464,58 +42808,63 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -38542,87 +42891,91 @@ export function bootstrap( const { status, body } = await implementation.projectsGetPermissionForUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - permission: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + permission: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -38652,41 +43005,45 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + [ + "401", z.object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -38713,47 +43070,51 @@ export function bootstrap( ctx ) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -38768,98 +43129,102 @@ export function bootstrap( const { status, body } = await implementation.rateLimitGet(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - resources: z.object({ - core: z.object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }), - graphql: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + resources: z.object({ + core: z.object({ limit: z.coerce.number(), remaining: z.coerce.number(), reset: z.coerce.number(), used: z.coerce.number(), - }) - .optional(), - search: z.object({ + }), + graphql: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + search: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), + source_import: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + integration_manifest: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + code_scanning_upload: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + actions_runner_registration: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + scim: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + dependency_snapshots: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + }), + rate: z.object({ limit: z.coerce.number(), remaining: z.coerce.number(), reset: z.coerce.number(), used: z.coerce.number(), }), - source_import: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - integration_manifest: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - code_scanning_upload: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - actions_runner_registration: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - scim: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - dependency_snapshots: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), }), - rate: z.object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), + ], + ["304", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -38893,199 +43258,202 @@ export function bootstrap( const { status, body } = await implementation.actionsListRepoRequiredWorkflows(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - required_workflows: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum(["active", "deleted"]), - source_repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + required_workflows: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + path: z.coerce.string(), + state: z.enum(["active", "deleted"]), + source_repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -39113,194 +43481,197 @@ export function bootstrap( const { status, body } = await implementation.actionsGetRepoRequiredWorkflow(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum(["active", "deleted"]), - source_repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + path: z.coerce.string(), + state: z.enum(["active", "deleted"]), + source_repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -39328,33 +43699,36 @@ export function bootstrap( const { status, body } = await implementation.actionsGetRepoRequiredWorkflowUsage(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - billable: z.object({ - UBUNTU: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - MACOS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - WINDOWS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + billable: z.object({ + UBUNTU: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + MACOS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + WINDOWS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + }), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -39374,130 +43748,166 @@ export function bootstrap( const { status, body } = await implementation.reposGet(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -39519,338 +43929,342 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - spdx_id: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -39872,284 +44286,286 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -40171,827 +44587,374 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ status: z.enum(["enabled", "disabled"]).optional() }) - .optional(), - secret_scanning: z - .object({ status: z.enum(["enabled", "disabled"]).optional() }) - .optional(), - secret_scanning_push_protection: z - .object({ status: z.enum(["enabled", "disabled"]).optional() }) - .optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const reposUpdateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposUpdateBodySchema = z - .object({ - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - visibility: z.enum(["public", "private"]).optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ status: z.coerce.string().optional() }) - .optional(), - secret_scanning: z - .object({ status: z.coerce.string().optional() }) - .optional(), - secret_scanning_push_protection: z - .object({ status: z.coerce.string().optional() }) - .optional(), - }) - .optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - default_branch: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), - archived: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }) - .optional() - - router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdate(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposUpdateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposUpdateBodySchema = z + .object({ + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + visibility: z.enum(["public", "private"]).optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.coerce.string().optional() }) .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + secret_scanning: z + .object({ status: z.coerce.string().optional() }) .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + secret_scanning_push_protection: z + .object({ status: z.coerce.string().optional() }) .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + }) + .optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + default_branch: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + archived: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }) + .optional() + + router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { + const input = { + params: parseRequestInput(reposUpdateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdate(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -41013,323 +44976,135 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -41351,1704 +45126,609 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ status: z.enum(["enabled", "disabled"]).optional() }) - .optional(), - secret_scanning: z - .object({ status: z.enum(["enabled", "disabled"]).optional() }) - .optional(), - secret_scanning_push_protection: z - .object({ status: z.enum(["enabled", "disabled"]).optional() }) - .optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 307) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const reposDeleteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete("reposDelete", "/repos/:owner/:repo", async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDelete(input, ctx) - - if (status === 307) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const actionsListArtifactsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsListArtifactsForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - name: z.coerce.string().optional(), - }) - - router.get( - "actionsListArtifactsForRepo", - "/repos/:owner/:repo/actions/artifacts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListArtifactsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListArtifactsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.actionsListArtifactsForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - artifacts: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetArtifactParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - artifact_id: z.coerce.number(), - }) - - router.get( - "actionsGetArtifact", - "/repos/:owner/:repo/actions/artifacts/:artifactId", - async (ctx, next) => { - const input = { - params: parseRequestInput(actionsGetArtifactParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetArtifact( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ - id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDeleteArtifactParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - artifact_id: z.coerce.number(), - }) - - router.delete( - "actionsDeleteArtifact", - "/repos/:owner/:repo/actions/artifacts/:artifactId", - async (ctx, next) => { - const input = { - params: parseRequestInput(actionsDeleteArtifactParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsDeleteArtifact( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const actionsDownloadArtifactParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - artifact_id: z.coerce.number(), - archive_format: z.coerce.string(), - }) - - router.get( - "actionsDownloadArtifact", - "/repos/:owner/:repo/actions/artifacts/:artifactId/:archiveFormat", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDownloadArtifactParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsDownloadArtifact( - input, - ctx - ) - - if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetActionsCacheUsageParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetActionsCacheUsage", - "/repos/:owner/:repo/actions/cache/usage", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetActionsCacheUsageParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetActionsCacheUsage( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - full_name: z.coerce.string(), - active_caches_size_in_bytes: z.coerce.number(), - active_caches_count: z.coerce.number(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetActionsCacheListParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsGetActionsCacheListQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - key: z.coerce.string().optional(), - sort: z - .enum(["created_at", "last_accessed_at", "size_in_bytes"]) - .optional(), - direction: z.enum(["asc", "desc"]).optional(), - }) - - router.get( - "actionsGetActionsCacheList", - "/repos/:owner/:repo/actions/caches", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetActionsCacheListParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsGetActionsCacheListQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.actionsGetActionsCacheList( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - actions_caches: z.array( - z.object({ - id: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - key: z.coerce.string().optional(), - version: z.coerce.string().optional(), - last_accessed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - size_in_bytes: z.coerce.number().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDeleteActionsCacheByKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsDeleteActionsCacheByKeyQuerySchema = z.object({ - key: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - - router.delete( - "actionsDeleteActionsCacheByKey", - "/repos/:owner/:repo/actions/caches", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteActionsCacheByKeyParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsDeleteActionsCacheByKeyQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsDeleteActionsCacheByKey(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - actions_caches: z.array( - z.object({ - id: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - key: z.coerce.string().optional(), - version: z.coerce.string().optional(), - last_accessed_at: z.coerce - .string() - .datetime({ offset: true }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) .optional(), - size_in_bytes: z.coerce.number().optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDeleteActionsCacheByIdParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - cache_id: z.coerce.number(), - }) - - router.delete( - "actionsDeleteActionsCacheById", - "/repos/:owner/:repo/actions/caches/:cacheId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteActionsCacheByIdParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsDeleteActionsCacheById(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsGetJobForWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - job_id: z.coerce.number(), - }) - - router.get( - "actionsGetJobForWorkflowRun", - "/repos/:owner/:repo/actions/jobs/:jobId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetJobForWorkflowRunParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetJobForWorkflowRun( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDownloadJobLogsForWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - job_id: z.coerce.number(), - }) - - router.get( - "actionsDownloadJobLogsForWorkflowRun", - "/repos/:owner/:repo/actions/jobs/:jobId/logs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDownloadJobLogsForWorkflowRunParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsReRunJobForWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - job_id: z.coerce.number(), - }) - - const actionsReRunJobForWorkflowRunBodySchema = z - .object({ enable_debug_logging: z.coerce.boolean().optional() }) - .optional() - - router.post( - "actionsReRunJobForWorkflowRun", - "/repos/:owner/:repo/actions/jobs/:jobId/rerun", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsReRunJobForWorkflowRunParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsReRunJobForWorkflowRunBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsReRunJobForWorkflowRun(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetCustomOidcSubClaimForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetCustomOidcSubClaimForRepo", - "/repos/:owner/:repo/actions/oidc/customization/sub", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetCustomOidcSubClaimForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetCustomOidcSubClaimForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - use_default: z.coerce.boolean(), - include_claim_keys: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetCustomOidcSubClaimForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetCustomOidcSubClaimForRepoBodySchema = z.object({ - use_default: z.coerce.boolean(), - include_claim_keys: z.array(z.coerce.string()).optional(), - }) - - router.put( - "actionsSetCustomOidcSubClaimForRepo", - "/repos/:owner/:repo/actions/oidc/customization/sub", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetCustomOidcSubClaimForRepoParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetCustomOidcSubClaimForRepoBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetCustomOidcSubClaimForRepo(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetGithubActionsPermissionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetGithubActionsPermissionsRepository", - "/repos/:owner/:repo/actions/permissions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetGithubActionsPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetGithubActionsPermissionsRepository( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - enabled: z.coerce.boolean(), - allowed_actions: z - .enum(["all", "local_only", "selected"]) - .optional(), - selected_actions_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetGithubActionsPermissionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetGithubActionsPermissionsRepositoryBodySchema = z.object({ - enabled: z.coerce.boolean(), - allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), - }) - - router.put( - "actionsSetGithubActionsPermissionsRepository", - "/repos/:owner/:repo/actions/permissions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetGithubActionsPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetGithubActionsPermissionsRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetGithubActionsPermissionsRepository( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const actionsGetWorkflowAccessToRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetWorkflowAccessToRepository", - "/repos/:owner/:repo/actions/permissions/access", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetWorkflowAccessToRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetWorkflowAccessToRepository(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - access_level: z.enum([ - "none", - "user", - "organization", - "enterprise", - ]), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetWorkflowAccessToRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetWorkflowAccessToRepositoryBodySchema = z.object({ - access_level: z.enum(["none", "user", "organization", "enterprise"]), - }) - - router.put( - "actionsSetWorkflowAccessToRepository", - "/repos/:owner/:repo/actions/permissions/access", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetWorkflowAccessToRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetWorkflowAccessToRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetWorkflowAccessToRepository(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsGetAllowedActionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetAllowedActionsRepository", - "/repos/:owner/:repo/actions/permissions/selected-actions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetAllowedActionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetAllowedActionsRepository(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetAllowedActionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetAllowedActionsRepositoryBodySchema = z - .object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }) - .optional() - - router.put( - "actionsSetAllowedActionsRepository", - "/repos/:owner/:repo/actions/permissions/selected-actions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetAllowedActionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetAllowedActionsRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetAllowedActionsRepository(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = - z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) - - router.get( - "actionsGetGithubActionsDefaultWorkflowPermissionsRepository", - "/repos/:owner/:repo/actions/permissions/workflow", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetGithubActionsDefaultWorkflowPermissionsRepository( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - default_workflow_permissions: z.enum(["read", "write"]), - can_approve_pull_request_reviews: z.coerce.boolean(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = - z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) - - const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema = - z.object({ - default_workflow_permissions: z.enum(["read", "write"]).optional(), - can_approve_pull_request_reviews: z.coerce.boolean().optional(), - }) - - router.put( - "actionsSetGithubActionsDefaultWorkflowPermissionsRepository", - "/repos/:owner/:repo/actions/permissions/workflow", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetGithubActionsDefaultWorkflowPermissionsRepository( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const actionsListRequiredWorkflowRunsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - required_workflow_id_for_repo: z.coerce.number(), - }) - - const actionsListRequiredWorkflowRunsQuerySchema = z.object({ - actor: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - event: z.coerce.string().optional(), - status: z - .enum([ - "completed", - "action_required", - "cancelled", - "failure", - "neutral", - "skipped", - "stale", - "success", - "timed_out", - "in_progress", - "queued", - "requested", - "waiting", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - created: z.coerce.string().datetime({ offset: true }).optional(), - exclude_pull_requests: z.coerce.boolean().optional(), - check_suite_id: z.coerce.number().optional(), - head_sha: z.coerce.string().optional(), - }) - - router.get( - "actionsListRequiredWorkflowRuns", - "/repos/:owner/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/runs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListRequiredWorkflowRunsParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListRequiredWorkflowRunsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsListRequiredWorkflowRuns(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -43070,948 +45750,914 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + ], + [ + "307", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposDeleteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete("reposDelete", "/repos/:owner/:repo", async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteParamSchema, ctx.params), + query: undefined, + body: undefined, } - ) - const actionsListSelfHostedRunnersForRepoParamSchema = z.object({ + const { status, body } = await implementation.reposDelete(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "307", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const actionsListArtifactsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const actionsListSelfHostedRunnersForRepoQuerySchema = z.object({ + const actionsListArtifactsForRepoQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), + name: z.coerce.string().optional(), }) router.get( - "actionsListSelfHostedRunnersForRepo", - "/repos/:owner/:repo/actions/runners", + "actionsListArtifactsForRepo", + "/repos/:owner/:repo/actions/artifacts", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListSelfHostedRunnersForRepoParamSchema, + actionsListArtifactsForRepoParamSchema, ctx.params ), query: parseRequestInput( - actionsListSelfHostedRunnersForRepoQuerySchema, + actionsListArtifactsForRepoQuerySchema, ctx.query ), body: undefined, } - const { status, body } = - await implementation.actionsListSelfHostedRunnersForRepo(input, ctx) + const { status, body } = await implementation.actionsListArtifactsForRepo( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetArtifactParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + artifact_id: z.coerce.number(), + }) + + router.get( + "actionsGetArtifact", + "/repos/:owner/:repo/actions/artifacts/:artifactId", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsGetArtifactParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.actionsGetArtifact( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListRunnerApplicationsForRepoParamSchema = z.object({ + const actionsDeleteArtifactParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + artifact_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteArtifact", + "/repos/:owner/:repo/actions/artifacts/:artifactId", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsDeleteArtifactParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsDeleteArtifact( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsDownloadArtifactParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + artifact_id: z.coerce.number(), + archive_format: z.coerce.string(), }) router.get( - "actionsListRunnerApplicationsForRepo", - "/repos/:owner/:repo/actions/runners/downloads", + "actionsDownloadArtifact", + "/repos/:owner/:repo/actions/artifacts/:artifactId/:archiveFormat", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListRunnerApplicationsForRepoParamSchema, + actionsDownloadArtifactParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsListRunnerApplicationsForRepo(input, ctx) + const { status, body } = await implementation.actionsDownloadArtifact( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + ["302", z.void()], + [ + "410", z.object({ - os: z.coerce.string(), - architecture: z.coerce.string(), - download_url: z.coerce.string(), - filename: z.coerce.string(), - temp_download_token: z.coerce.string().optional(), - sha256_checksum: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsCreateRegistrationTokenForRepoParamSchema = z.object({ + const actionsGetActionsCacheUsageParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.post( - "actionsCreateRegistrationTokenForRepo", - "/repos/:owner/:repo/actions/runners/registration-token", + router.get( + "actionsGetActionsCacheUsage", + "/repos/:owner/:repo/actions/cache/usage", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateRegistrationTokenForRepoParamSchema, + actionsGetActionsCacheUsageParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsCreateRegistrationTokenForRepo(input, ctx) + const { status, body } = await implementation.actionsGetActionsCacheUsage( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + full_name: z.coerce.string(), + active_caches_size_in_bytes: z.coerce.number(), + active_caches_count: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetActionsCacheListParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsGetActionsCacheListQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + sort: z + .enum(["created_at", "last_accessed_at", "size_in_bytes"]) + .optional(), + direction: z.enum(["asc", "desc"]).optional(), + }) + + router.get( + "actionsGetActionsCacheList", + "/repos/:owner/:repo/actions/caches", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetActionsCacheListParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsGetActionsCacheListQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.actionsGetActionsCacheList( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + actions_caches: z.array( + z.object({ + id: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + version: z.coerce.string().optional(), + last_accessed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + created_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + size_in_bytes: z.coerce.number().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteActionsCacheByKeyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsDeleteActionsCacheByKeyQuerySchema = z.object({ + key: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + + router.delete( + "actionsDeleteActionsCacheByKey", + "/repos/:owner/:repo/actions/caches", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteActionsCacheByKeyParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsDeleteActionsCacheByKeyQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteActionsCacheByKey(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + actions_caches: z.array( + z.object({ + id: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + version: z.coerce.string().optional(), + last_accessed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + created_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), + size_in_bytes: z.coerce.number().optional(), }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }) - .parse(body) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteActionsCacheByIdParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + cache_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteActionsCacheById", + "/repos/:owner/:repo/actions/caches/:cacheId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteActionsCacheByIdParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.actionsDeleteActionsCacheById(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsCreateRemoveTokenForRepoParamSchema = z.object({ + const actionsGetJobForWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + job_id: z.coerce.number(), }) - router.post( - "actionsCreateRemoveTokenForRepo", - "/repos/:owner/:repo/actions/runners/remove-token", + router.get( + "actionsGetJobForWorkflowRun", + "/repos/:owner/:repo/actions/jobs/:jobId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateRemoveTokenForRepoParamSchema, + actionsGetJobForWorkflowRunParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsCreateRemoveTokenForRepo(input, ctx) + const { status, body } = await implementation.actionsGetJobForWorkflowRun( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }) - .parse(body) - } - + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsDownloadJobLogsForWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), + job_id: z.coerce.number(), }) router.get( - "actionsGetSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId", + "actionsDownloadJobLogsForWorkflowRun", + "/repos/:owner/:repo/actions/jobs/:jobId/logs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetSelfHostedRunnerForRepoParamSchema, + actionsDownloadJobLogsForWorkflowRunParamSchema, ctx.params ), query: undefined, @@ -44019,72 +46665,78 @@ export function bootstrap( } const { status, body } = - await implementation.actionsGetSelfHostedRunnerForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } + await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsDeleteSelfHostedRunnerFromRepoParamSchema = z.object({ + const actionsReRunJobForWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), + job_id: z.coerce.number(), }) - router.delete( - "actionsDeleteSelfHostedRunnerFromRepo", - "/repos/:owner/:repo/actions/runners/:runnerId", + const actionsReRunJobForWorkflowRunBodySchema = z + .object({ enable_debug_logging: z.coerce.boolean().optional() }) + .optional() + + router.post( + "actionsReRunJobForWorkflowRun", + "/repos/:owner/:repo/actions/jobs/:jobId/rerun", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteSelfHostedRunnerFromRepoParamSchema, + actionsReRunJobForWorkflowRunParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + actionsReRunJobForWorkflowRunBodySchema, + ctx.body + ), } const { status, body } = - await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) + await implementation.actionsReRunJobForWorkflowRun(input, ctx) + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsGetCustomOidcSubClaimForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), }) router.get( - "actionsListLabelsForSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + "actionsGetCustomOidcSubClaimForRepo", + "/repos/:owner/:repo/actions/oidc/customization/sub", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListLabelsForSelfHostedRunnerForRepoParamSchema, + actionsGetCustomOidcSubClaimForRepoParamSchema, ctx.params ), query: undefined, @@ -44092,248 +46744,210 @@ export function bootstrap( } const { status, body } = - await implementation.actionsListLabelsForSelfHostedRunnerForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.actionsGetCustomOidcSubClaimForRepo(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + use_default: z.coerce.boolean(), + include_claim_keys: z.array(z.coerce.string()).optional(), + }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsSetCustomOidcSubClaimForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), }) - const actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema = z.object({ - labels: z.array(z.coerce.string()), + const actionsSetCustomOidcSubClaimForRepoBodySchema = z.object({ + use_default: z.coerce.boolean(), + include_claim_keys: z.array(z.coerce.string()).optional(), }) - router.post( - "actionsAddCustomLabelsToSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + router.put( + "actionsSetCustomOidcSubClaimForRepo", + "/repos/:owner/:repo/actions/oidc/customization/sub", async (ctx, next) => { const input = { params: parseRequestInput( - actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema, + actionsSetCustomOidcSubClaimForRepoParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema, + actionsSetCustomOidcSubClaimForRepoBodySchema, ctx.body ), } const { status, body } = - await implementation.actionsAddCustomLabelsToSelfHostedRunnerForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } + await implementation.actionsSetCustomOidcSubClaimForRepo(input, ctx) + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsGetGithubActionsPermissionsRepositoryParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), - }) - - const actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema = z.object({ - labels: z.array(z.coerce.string()), }) - router.put( - "actionsSetCustomLabelsForSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + router.get( + "actionsGetGithubActionsPermissionsRepository", + "/repos/:owner/:repo/actions/permissions", async (ctx, next) => { const input = { params: parseRequestInput( - actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema, + actionsGetGithubActionsPermissionsRepositoryParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.actionsSetCustomLabelsForSelfHostedRunnerForRepo( + await implementation.actionsGetGithubActionsPermissionsRepository( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + enabled: z.coerce.boolean(), + allowed_actions: z + .enum(["all", "local_only", "selected"]) + .optional(), + selected_actions_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema = - z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - runner_id: z.coerce.number(), - }) + const actionsSetGithubActionsPermissionsRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) - router.delete( - "actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + const actionsSetGithubActionsPermissionsRepositoryBodySchema = z.object({ + enabled: z.coerce.boolean(), + allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), + }) + + router.put( + "actionsSetGithubActionsPermissionsRepository", + "/repos/:owner/:repo/actions/permissions", async (ctx, next) => { const input = { params: parseRequestInput( - actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema, + actionsSetGithubActionsPermissionsRepositoryParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + actionsSetGithubActionsPermissionsRepositoryBodySchema, + ctx.body + ), } const { status, body } = - await implementation.actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo( + await implementation.actionsSetGithubActionsPermissionsRepository( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema = - z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - runner_id: z.coerce.number(), - name: z.coerce.string(), - }) + const actionsGetWorkflowAccessToRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) - router.delete( - "actionsRemoveCustomLabelFromSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels/:name", + router.get( + "actionsGetWorkflowAccessToRepository", + "/repos/:owner/:repo/actions/permissions/access", async (ctx, next) => { const input = { params: parseRequestInput( - actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema, + actionsGetWorkflowAccessToRepositoryParamSchema, ctx.params ), query: undefined, @@ -44341,54 +46955,235 @@ export function bootstrap( } const { status, body } = - await implementation.actionsRemoveCustomLabelFromSelfHostedRunnerForRepo( - input, - ctx - ) + await implementation.actionsGetWorkflowAccessToRepository(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + access_level: z.enum([ + "none", + "user", + "organization", + "enterprise", + ]), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetWorkflowAccessToRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsSetWorkflowAccessToRepositoryBodySchema = z.object({ + access_level: z.enum(["none", "user", "organization", "enterprise"]), + }) + + router.put( + "actionsSetWorkflowAccessToRepository", + "/repos/:owner/:repo/actions/permissions/access", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetWorkflowAccessToRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetWorkflowAccessToRepositoryBodySchema, + ctx.body + ), } + const { status, body } = + await implementation.actionsSetWorkflowAccessToRepository(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsListWorkflowRunsForRepoParamSchema = z.object({ + const actionsGetAllowedActionsRepositoryParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const actionsListWorkflowRunsForRepoQuerySchema = z.object({ + router.get( + "actionsGetAllowedActionsRepository", + "/repos/:owner/:repo/actions/permissions/selected-actions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetAllowedActionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetAllowedActionsRepository(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + github_owned_allowed: z.coerce.boolean().optional(), + verified_allowed: z.coerce.boolean().optional(), + patterns_allowed: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetAllowedActionsRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsSetAllowedActionsRepositoryBodySchema = z + .object({ + github_owned_allowed: z.coerce.boolean().optional(), + verified_allowed: z.coerce.boolean().optional(), + patterns_allowed: z.array(z.coerce.string()).optional(), + }) + .optional() + + router.put( + "actionsSetAllowedActionsRepository", + "/repos/:owner/:repo/actions/permissions/selected-actions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetAllowedActionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetAllowedActionsRepositoryBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetAllowedActionsRepository(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = + z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + + router.get( + "actionsGetGithubActionsDefaultWorkflowPermissionsRepository", + "/repos/:owner/:repo/actions/permissions/workflow", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetGithubActionsDefaultWorkflowPermissionsRepository( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + default_workflow_permissions: z.enum(["read", "write"]), + can_approve_pull_request_reviews: z.coerce.boolean(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = + z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + + const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema = + z.object({ + default_workflow_permissions: z.enum(["read", "write"]).optional(), + can_approve_pull_request_reviews: z.coerce.boolean().optional(), + }) + + router.put( + "actionsSetGithubActionsDefaultWorkflowPermissionsRepository", + "/repos/:owner/:repo/actions/permissions/workflow", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetGithubActionsDefaultWorkflowPermissionsRepository( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsListRequiredWorkflowRunsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + required_workflow_id_for_repo: z.coerce.number(), + }) + + const actionsListRequiredWorkflowRunsQuerySchema = z.object({ actor: z.coerce.string().optional(), branch: z.coerce.string().optional(), event: z.coerce.string().optional(), @@ -44418,1826 +47213,1388 @@ export function bootstrap( }) router.get( - "actionsListWorkflowRunsForRepo", - "/repos/:owner/:repo/actions/runs", + "actionsListRequiredWorkflowRuns", + "/repos/:owner/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/runs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListWorkflowRunsForRepoParamSchema, + actionsListRequiredWorkflowRunsParamSchema, ctx.params ), query: parseRequestInput( - actionsListWorkflowRunsForRepoQuerySchema, + actionsListRequiredWorkflowRunsQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.actionsListWorkflowRunsForRepo(input, ctx) + await implementation.actionsListRequiredWorkflowRuns(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ id: z.coerce.number(), + name: z.coerce.string().optional(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - license: z + triggering_actor: z .object({ - key: z.coerce.string().optional(), name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + run_started_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetWorkflowRunParamSchema = z.object({ + const actionsListSelfHostedRunnersForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) - const actionsGetWorkflowRunQuerySchema = z.object({ - exclude_pull_requests: z.coerce.boolean().optional(), + const actionsListSelfHostedRunnersForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "actionsGetWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId", + "actionsListSelfHostedRunnersForRepo", + "/repos/:owner/:repo/actions/runners", async (ctx, next) => { const input = { - params: parseRequestInput(actionsGetWorkflowRunParamSchema, ctx.params), - query: parseRequestInput(actionsGetWorkflowRunQuerySchema, ctx.query), + params: parseRequestInput( + actionsListSelfHostedRunnersForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListSelfHostedRunnersForRepoQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.actionsGetWorkflowRun( - input, - ctx - ) + const { status, body } = + await implementation.actionsListSelfHostedRunnersForRepo(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runners: z.array( z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + ), }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDeleteWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) - - router.delete( - "actionsDeleteWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteWorkflowRunParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsDeleteWorkflowRun( - input, - ctx - ) - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetReviewsForRunParamSchema = z.object({ + const actionsListRunnerApplicationsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) router.get( - "actionsGetReviewsForRun", - "/repos/:owner/:repo/actions/runs/:runId/approvals", + "actionsListRunnerApplicationsForRepo", + "/repos/:owner/:repo/actions/runners/downloads", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetReviewsForRunParamSchema, + actionsListRunnerApplicationsForRepoParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetReviewsForRun( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - environments: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - state: z.enum(["approved", "rejected"]), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comment: z.coerce.string(), - }) - ) - .parse(body) - } + const { status, body } = + await implementation.actionsListRunnerApplicationsForRepo(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsApproveWorkflowRunParamSchema = z.object({ + const actionsCreateRegistrationTokenForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) router.post( - "actionsApproveWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/approve", + "actionsCreateRegistrationTokenForRepo", + "/repos/:owner/:repo/actions/runners/registration-token", async (ctx, next) => { const input = { params: parseRequestInput( - actionsApproveWorkflowRunParamSchema, + actionsCreateRegistrationTokenForRepoParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsApproveWorkflowRun( - input, - ctx - ) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.actionsCreateRegistrationTokenForRepo(input, ctx) - ctx.status = status - return next() - } - ) - - const actionsListWorkflowRunArtifactsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) - - const actionsListWorkflowRunArtifactsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "actionsListWorkflowRunArtifacts", - "/repos/:owner/:repo/actions/runs/:runId/artifacts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListWorkflowRunArtifactsParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListWorkflowRunArtifactsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsListWorkflowRunArtifacts(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - artifacts: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ - id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - .optional(), - }) - ), - }) - .parse(body) - } - + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetWorkflowRunAttemptParamSchema = z.object({ + const actionsCreateRemoveTokenForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), - attempt_number: z.coerce.number(), - }) - - const actionsGetWorkflowRunAttemptQuerySchema = z.object({ - exclude_pull_requests: z.coerce.boolean().optional(), }) - router.get( - "actionsGetWorkflowRunAttempt", - "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber", + router.post( + "actionsCreateRemoveTokenForRepo", + "/repos/:owner/:repo/actions/runners/remove-token", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetWorkflowRunAttemptParamSchema, + actionsCreateRemoveTokenForRepoParamSchema, ctx.params ), - query: parseRequestInput( - actionsGetWorkflowRunAttemptQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } const { status, body } = - await implementation.actionsGetWorkflowRunAttempt(input, ctx) + await implementation.actionsCreateRemoveTokenForRepo(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ id: z.coerce.number(), - url: z.coerce.string(), + node_id: z.coerce.string(), name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), }), - repository: z.object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetSelfHostedRunnerForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + runner_id: z.coerce.number(), + }) + + router.get( + "actionsGetSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetSelfHostedRunnerForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetSelfHostedRunnerForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + type: z.enum(["read-only", "custom"]).optional(), }) - .optional(), + ), }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListJobsForWorkflowRunAttemptParamSchema = z.object({ + const actionsDeleteSelfHostedRunnerFromRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), - attempt_number: z.coerce.number(), - }) - - const actionsListJobsForWorkflowRunAttemptQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + runner_id: z.coerce.number(), }) - router.get( - "actionsListJobsForWorkflowRunAttempt", - "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/jobs", + router.delete( + "actionsDeleteSelfHostedRunnerFromRepo", + "/repos/:owner/:repo/actions/runners/:runnerId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListJobsForWorkflowRunAttemptParamSchema, + actionsDeleteSelfHostedRunnerFromRepoParamSchema, ctx.params ), - query: parseRequestInput( - actionsListJobsForWorkflowRunAttemptQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } const { status, body } = - await implementation.actionsListJobsForWorkflowRunAttempt(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - jobs: z.array( - z.object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsDownloadWorkflowRunAttemptLogsParamSchema = z.object({ + const actionsListLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), - attempt_number: z.coerce.number(), + runner_id: z.coerce.number(), }) router.get( - "actionsDownloadWorkflowRunAttemptLogs", - "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/logs", + "actionsListLabelsForSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDownloadWorkflowRunAttemptLogsParamSchema, + actionsListLabelsForSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, @@ -46245,190 +48602,201 @@ export function bootstrap( } const { status, body } = - await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) - - ctx.status = status - return next() - } - ) - - const actionsCancelWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) - - router.post( - "actionsCancelWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/cancel", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsCancelWorkflowRunParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsCancelWorkflowRun( - input, - ctx - ) - - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.actionsListLabelsForSelfHostedRunnerForRepo( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListJobsForWorkflowRunParamSchema = z.object({ + const actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + runner_id: z.coerce.number(), }) - const actionsListJobsForWorkflowRunQuerySchema = z.object({ - filter: z.enum(["latest", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema = z.object({ + labels: z.array(z.coerce.string()), }) - router.get( - "actionsListJobsForWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/jobs", + router.post( + "actionsAddCustomLabelsToSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListJobsForWorkflowRunParamSchema, + actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema, ctx.params ), - query: parseRequestInput( - actionsListJobsForWorkflowRunQuerySchema, - ctx.query + query: undefined, + body: parseRequestInput( + actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.actionsListJobsForWorkflowRun(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - jobs: z.array( - z.object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), - }) - ), - }) - .parse(body) - } + await implementation.actionsAddCustomLabelsToSelfHostedRunnerForRepo( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDownloadWorkflowRunLogsParamSchema = z.object({ + const actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + runner_id: z.coerce.number(), }) - router.get( - "actionsDownloadWorkflowRunLogs", - "/repos/:owner/:repo/actions/runs/:runId/logs", + const actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema = z.object({ + labels: z.array(z.coerce.string()), + }) + + router.put( + "actionsSetCustomLabelsForSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDownloadWorkflowRunLogsParamSchema, + actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema, + ctx.body + ), } const { status, body } = - await implementation.actionsDownloadWorkflowRunLogs(input, ctx) + await implementation.actionsSetCustomLabelsForSelfHostedRunnerForRepo( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDeleteWorkflowRunLogsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) + const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema = + z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + runner_id: z.coerce.number(), + }) router.delete( - "actionsDeleteWorkflowRunLogs", - "/repos/:owner/:repo/actions/runs/:runId/logs", + "actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteWorkflowRunLogsParamSchema, + actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, @@ -46436,46 +48804,58 @@ export function bootstrap( } const { status, body } = - await implementation.actionsDeleteWorkflowRunLogs(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetPendingDeploymentsForRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) + const actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema = + z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + runner_id: z.coerce.number(), + name: z.coerce.string(), + }) - router.get( - "actionsGetPendingDeploymentsForRun", - "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", + router.delete( + "actionsRemoveCustomLabelFromSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels/:name", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetPendingDeploymentsForRunParamSchema, + actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, @@ -46483,1572 +48863,2185 @@ export function bootstrap( } const { status, body } = - await implementation.actionsGetPendingDeploymentsForRun(input, ctx) + await implementation.actionsRemoveCustomLabelFromSelfHostedRunnerForRepo( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - environment: z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }), - wait_timer: z.coerce.number(), - wait_timer_started_at: z.coerce - .string() - .datetime({ offset: true }), - current_user_can_approve: z.coerce.boolean(), - reviewers: z.array( + total_count: z.coerce.number(), + labels: z.array( z.object({ - type: z.enum(["User", "Team"]).optional(), - reviewer: z.object({}).optional(), + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), }) ), - }) - ) - .parse(body) - } - + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsReviewPendingDeploymentsForRunParamSchema = z.object({ + const actionsListWorkflowRunsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) - const actionsReviewPendingDeploymentsForRunBodySchema = z.object({ - environment_ids: z.array(z.coerce.number()), - state: z.enum(["approved", "rejected"]), - comment: z.coerce.string(), + const actionsListWorkflowRunsForRepoQuerySchema = z.object({ + actor: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + event: z.coerce.string().optional(), + status: z + .enum([ + "completed", + "action_required", + "cancelled", + "failure", + "neutral", + "skipped", + "stale", + "success", + "timed_out", + "in_progress", + "queued", + "requested", + "waiting", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + created: z.coerce.string().datetime({ offset: true }).optional(), + exclude_pull_requests: z.coerce.boolean().optional(), + check_suite_id: z.coerce.number().optional(), + head_sha: z.coerce.string().optional(), }) - router.post( - "actionsReviewPendingDeploymentsForRun", - "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", + router.get( + "actionsListWorkflowRunsForRepo", + "/repos/:owner/:repo/actions/runs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsReviewPendingDeploymentsForRunParamSchema, + actionsListWorkflowRunsForRepoParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - actionsReviewPendingDeploymentsForRunBodySchema, - ctx.body + query: parseRequestInput( + actionsListWorkflowRunsForRepoQuerySchema, + ctx.query ), + body: undefined, } const { status, body } = - await implementation.actionsReviewPendingDeploymentsForRun(input, ctx) + await implementation.actionsListWorkflowRunsForRepo(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), + name: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), }) - .optional(), - }) - ) - .parse(body) - } - + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsReRunWorkflowParamSchema = z.object({ + const actionsGetWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), run_id: z.coerce.number(), }) - const actionsReRunWorkflowBodySchema = z - .object({ enable_debug_logging: z.coerce.boolean().optional() }) - .optional() + const actionsGetWorkflowRunQuerySchema = z.object({ + exclude_pull_requests: z.coerce.boolean().optional(), + }) - router.post( - "actionsReRunWorkflow", - "/repos/:owner/:repo/actions/runs/:runId/rerun", + router.get( + "actionsGetWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId", async (ctx, next) => { const input = { - params: parseRequestInput(actionsReRunWorkflowParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(actionsReRunWorkflowBodySchema, ctx.body), + params: parseRequestInput(actionsGetWorkflowRunParamSchema, ctx.params), + query: parseRequestInput(actionsGetWorkflowRunQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.actionsReRunWorkflow( + const { status, body } = await implementation.actionsGetWorkflowRun( input, ctx ) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsReRunWorkflowFailedJobsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) - - const actionsReRunWorkflowFailedJobsBodySchema = z - .object({ enable_debug_logging: z.coerce.boolean().optional() }) - .optional() - - router.post( - "actionsReRunWorkflowFailedJobs", - "/repos/:owner/:repo/actions/runs/:runId/rerun-failed-jobs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsReRunWorkflowFailedJobsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsReRunWorkflowFailedJobsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsReRunWorkflowFailedJobs(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetWorkflowRunUsageParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) - - router.get( - "actionsGetWorkflowRunUsage", - "/repos/:owner/:repo/actions/runs/:runId/timing", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetWorkflowRunUsageParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetWorkflowRunUsage( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - billable: z.object({ - UBUNTU: z - .object({ - total_ms: z.coerce.number(), - jobs: z.coerce.number(), - job_runs: z - .array( - z.object({ - job_id: z.coerce.number(), - duration_ms: z.coerce.number(), - }) - ) - .optional(), - }) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) .optional(), - MACOS: z + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z .object({ - total_ms: z.coerce.number(), - jobs: z.coerce.number(), - job_runs: z - .array( - z.object({ - job_id: z.coerce.number(), - duration_ms: z.coerce.number(), - }) - ) - .optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - WINDOWS: z + triggering_actor: z .object({ - total_ms: z.coerce.number(), - jobs: z.coerce.number(), - job_runs: z - .array( - z.object({ - job_id: z.coerce.number(), - duration_ms: z.coerce.number(), - }) - ) - .optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), }), - run_duration_ms: z.coerce.number().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListRepoSecretsParamSchema = z.object({ + const actionsDeleteWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) - const actionsListRepoSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "actionsListRepoSecrets", - "/repos/:owner/:repo/actions/secrets", + router.delete( + "actionsDeleteWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListRepoSecretsParamSchema, + actionsDeleteWorkflowRunParamSchema, ctx.params ), - query: parseRequestInput(actionsListRepoSecretsQuerySchema, ctx.query), + query: undefined, body: undefined, } - const { status, body } = await implementation.actionsListRepoSecrets( + const { status, body } = await implementation.actionsDeleteWorkflowRun( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsGetRepoPublicKeyParamSchema = z.object({ + const actionsGetReviewsForRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) router.get( - "actionsGetRepoPublicKey", - "/repos/:owner/:repo/actions/secrets/public-key", + "actionsGetReviewsForRun", + "/repos/:owner/:repo/actions/runs/:runId/approvals", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetRepoPublicKeyParamSchema, + actionsGetReviewsForRunParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetRepoPublicKey( + const { status, body } = await implementation.actionsGetReviewsForRun( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.get( - "actionsGetRepoSecret", - "/repos/:owner/:repo/actions/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput(actionsGetRepoSecretParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetRepoSecret( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsCreateOrUpdateRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const actionsCreateOrUpdateRepoSecretBodySchema = z.object({ - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string().optional(), - }) - - router.put( - "actionsCreateOrUpdateRepoSecret", - "/repos/:owner/:repo/actions/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsCreateOrUpdateRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsCreateOrUpdateRepoSecretBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsCreateOrUpdateRepoSecret(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + environments: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + state: z.enum(["approved", "rejected"]), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comment: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDeleteRepoSecretParamSchema = z.object({ + const actionsApproveWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - secret_name: z.coerce.string(), + run_id: z.coerce.number(), }) - router.delete( - "actionsDeleteRepoSecret", - "/repos/:owner/:repo/actions/secrets/:secretName", + router.post( + "actionsApproveWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/approve", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteRepoSecretParamSchema, + actionsApproveWorkflowRunParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsDeleteRepoSecret( + const { status, body } = await implementation.actionsApproveWorkflowRun( input, ctx ) + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListRepoVariablesParamSchema = z.object({ + const actionsListWorkflowRunArtifactsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) - const actionsListRepoVariablesQuerySchema = z.object({ + const actionsListWorkflowRunArtifactsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "actionsListRepoVariables", - "/repos/:owner/:repo/actions/variables", + "actionsListWorkflowRunArtifacts", + "/repos/:owner/:repo/actions/runs/:runId/artifacts", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListRepoVariablesParamSchema, + actionsListWorkflowRunArtifactsParamSchema, ctx.params ), query: parseRequestInput( - actionsListRepoVariablesQuerySchema, + actionsListWorkflowRunArtifactsQuerySchema, ctx.query ), body: undefined, } - const { status, body } = await implementation.actionsListRepoVariables( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsCreateRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsCreateRepoVariableBodySchema = z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - }) - - router.post( - "actionsCreateRepoVariable", - "/repos/:owner/:repo/actions/variables", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsCreateRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(actionsCreateRepoVariableBodySchema, ctx.body), - } - - const { status, body } = await implementation.actionsCreateRepoVariable( - input, - ctx - ) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.get( - "actionsGetRepoVariable", - "/repos/:owner/:repo/actions/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetRepoVariable( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsUpdateRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - const actionsUpdateRepoVariableBodySchema = z.object({ - name: z.coerce.string().optional(), - value: z.coerce.string().optional(), - }) - - router.patch( - "actionsUpdateRepoVariable", - "/repos/:owner/:repo/actions/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsUpdateRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(actionsUpdateRepoVariableBodySchema, ctx.body), - } - - const { status, body } = await implementation.actionsUpdateRepoVariable( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const actionsDeleteRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.delete( - "actionsDeleteRepoVariable", - "/repos/:owner/:repo/actions/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsDeleteRepoVariable( - input, - ctx - ) + const { status, body } = + await implementation.actionsListWorkflowRunArtifacts(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListRepoWorkflowsParamSchema = z.object({ + const actionsGetWorkflowRunAttemptParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), + attempt_number: z.coerce.number(), }) - const actionsListRepoWorkflowsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const actionsGetWorkflowRunAttemptQuerySchema = z.object({ + exclude_pull_requests: z.coerce.boolean().optional(), }) router.get( - "actionsListRepoWorkflows", - "/repos/:owner/:repo/actions/workflows", + "actionsGetWorkflowRunAttempt", + "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListRepoWorkflowsParamSchema, + actionsGetWorkflowRunAttemptParamSchema, ctx.params ), query: parseRequestInput( - actionsListRepoWorkflowsQuerySchema, + actionsGetWorkflowRunAttemptQuerySchema, ctx.query ), body: undefined, } - const { status, body } = await implementation.actionsListRepoWorkflows( - input, - ctx - ) + const { status, body } = + await implementation.actionsGetWorkflowRunAttempt(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - workflows: z.array( - z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum([ - "active", - "deleted", - "disabled_fork", - "disabled_inactivity", - "disabled_manually", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - badge_url: z.coerce.string(), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsGetWorkflowParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), - }) - - router.get( - "actionsGetWorkflow", - "/repos/:owner/:repo/actions/workflows/:workflowId", - async (ctx, next) => { - const input = { - params: parseRequestInput(actionsGetWorkflowParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsGetWorkflow( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum([ - "active", - "deleted", - "disabled_fork", - "disabled_inactivity", - "disabled_manually", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - deleted_at: z.coerce.string().datetime({ offset: true }).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsDisableWorkflowParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), - }) - - router.put( - "actionsDisableWorkflow", - "/repos/:owner/:repo/actions/workflows/:workflowId/disable", - async (ctx, next) => { + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsListJobsForWorkflowRunAttemptParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + attempt_number: z.coerce.number(), + }) + + const actionsListJobsForWorkflowRunAttemptQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListJobsForWorkflowRunAttempt", + "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/jobs", + async (ctx, next) => { const input = { params: parseRequestInput( - actionsDisableWorkflowParamSchema, + actionsListJobsForWorkflowRunAttemptParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + actionsListJobsForWorkflowRunAttemptQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.actionsDisableWorkflow( - input, - ctx - ) + const { status, body } = + await implementation.actionsListJobsForWorkflowRunAttempt(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + jobs: z.array( + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsCreateWorkflowDispatchParamSchema = z.object({ + const actionsDownloadWorkflowRunAttemptLogsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), - }) - - const actionsCreateWorkflowDispatchBodySchema = z.object({ - ref: z.coerce.string(), - inputs: z.object({}).optional(), + run_id: z.coerce.number(), + attempt_number: z.coerce.number(), }) - router.post( - "actionsCreateWorkflowDispatch", - "/repos/:owner/:repo/actions/workflows/:workflowId/dispatches", + router.get( + "actionsDownloadWorkflowRunAttemptLogs", + "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/logs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateWorkflowDispatchParamSchema, + actionsDownloadWorkflowRunAttemptLogsParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsCreateWorkflowDispatchBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.actionsCreateWorkflowDispatch(input, ctx) + await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsEnableWorkflowParamSchema = z.object({ + const actionsCancelWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + run_id: z.coerce.number(), }) - router.put( - "actionsEnableWorkflow", - "/repos/:owner/:repo/actions/workflows/:workflowId/enable", + router.post( + "actionsCancelWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/cancel", async (ctx, next) => { const input = { - params: parseRequestInput(actionsEnableWorkflowParamSchema, ctx.params), + params: parseRequestInput( + actionsCancelWorkflowRunParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsEnableWorkflow( + const { status, body } = await implementation.actionsCancelWorkflowRun( input, ctx ) + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListWorkflowRunsParamSchema = z.object({ + const actionsListJobsForWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + run_id: z.coerce.number(), }) - const actionsListWorkflowRunsQuerySchema = z.object({ - actor: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - event: z.coerce.string().optional(), - status: z - .enum([ - "completed", - "action_required", - "cancelled", - "failure", - "neutral", - "skipped", - "stale", - "success", - "timed_out", - "in_progress", - "queued", - "requested", - "waiting", - ]) - .optional(), + const actionsListJobsForWorkflowRunQuerySchema = z.object({ + filter: z.enum(["latest", "all"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - created: z.coerce.string().datetime({ offset: true }).optional(), - exclude_pull_requests: z.coerce.boolean().optional(), - check_suite_id: z.coerce.number().optional(), - head_sha: z.coerce.string().optional(), }) router.get( - "actionsListWorkflowRuns", - "/repos/:owner/:repo/actions/workflows/:workflowId/runs", + "actionsListJobsForWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/jobs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListWorkflowRunsParamSchema, + actionsListJobsForWorkflowRunParamSchema, ctx.params ), - query: parseRequestInput(actionsListWorkflowRunsQuerySchema, ctx.query), + query: parseRequestInput( + actionsListJobsForWorkflowRunQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.actionsListWorkflowRuns( - input, - ctx - ) + const { status, body } = + await implementation.actionsListJobsForWorkflowRun(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + jobs: z.array( + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }) - .parse(body) - } - + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetWorkflowUsageParamSchema = z.object({ + const actionsDownloadWorkflowRunLogsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + run_id: z.coerce.number(), }) router.get( - "actionsGetWorkflowUsage", - "/repos/:owner/:repo/actions/workflows/:workflowId/timing", + "actionsDownloadWorkflowRunLogs", + "/repos/:owner/:repo/actions/runs/:runId/logs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetWorkflowUsageParamSchema, + actionsDownloadWorkflowRunLogsParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetWorkflowUsage( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - billable: z.object({ - UBUNTU: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - MACOS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - WINDOWS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - }), - }) - .parse(body) - } + const { status, body } = + await implementation.actionsDownloadWorkflowRunLogs(input, ctx) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const issuesListAssigneesParamSchema = z.object({ + const actionsDeleteWorkflowRunLogsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) - const issuesListAssigneesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListAssignees", - "/repos/:owner/:repo/assignees", + router.delete( + "actionsDeleteWorkflowRunLogs", + "/repos/:owner/:repo/actions/runs/:runId/logs", async (ctx, next) => { const input = { - params: parseRequestInput(issuesListAssigneesParamSchema, ctx.params), - query: parseRequestInput(issuesListAssigneesQuerySchema, ctx.query), + params: parseRequestInput( + actionsDeleteWorkflowRunLogsParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.issuesListAssignees( - input, - ctx - ) + const { status, body } = + await implementation.actionsDeleteWorkflowRunLogs(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesCheckUserCanBeAssignedParamSchema = z.object({ + const actionsGetPendingDeploymentsForRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - assignee: z.coerce.string(), + run_id: z.coerce.number(), }) router.get( - "issuesCheckUserCanBeAssigned", - "/repos/:owner/:repo/assignees/:assignee", + "actionsGetPendingDeploymentsForRun", + "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", async (ctx, next) => { const input = { params: parseRequestInput( - issuesCheckUserCanBeAssignedParamSchema, + actionsGetPendingDeploymentsForRunParamSchema, ctx.params ), query: undefined, @@ -48056,2454 +51049,1094 @@ export function bootstrap( } const { status, body } = - await implementation.issuesCheckUserCanBeAssigned(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.actionsGetPendingDeploymentsForRun(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + environment: z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }), + wait_timer: z.coerce.number(), + wait_timer_started_at: z.coerce + .string() + .datetime({ offset: true }), + current_user_can_approve: z.coerce.boolean(), + reviewers: z.array( + z.object({ + type: z.enum(["User", "Team"]).optional(), + reviewer: z.object({}).optional(), + }) + ), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListAutolinksParamSchema = z.object({ + const actionsReviewPendingDeploymentsForRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) - const reposListAutolinksQuerySchema = z.object({ - page: z.coerce.number().optional(), + const actionsReviewPendingDeploymentsForRunBodySchema = z.object({ + environment_ids: z.array(z.coerce.number()), + state: z.enum(["approved", "rejected"]), + comment: z.coerce.string(), + }) + + router.post( + "actionsReviewPendingDeploymentsForRun", + "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsReviewPendingDeploymentsForRunParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsReviewPendingDeploymentsForRunBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsReviewPendingDeploymentsForRun(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsReRunWorkflowParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + }) + + const actionsReRunWorkflowBodySchema = z + .object({ enable_debug_logging: z.coerce.boolean().optional() }) + .optional() + + router.post( + "actionsReRunWorkflow", + "/repos/:owner/:repo/actions/runs/:runId/rerun", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsReRunWorkflowParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(actionsReRunWorkflowBodySchema, ctx.body), + } + + const { status, body } = await implementation.actionsReRunWorkflow( + input, + ctx + ) + + ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsReRunWorkflowFailedJobsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + }) + + const actionsReRunWorkflowFailedJobsBodySchema = z + .object({ enable_debug_logging: z.coerce.boolean().optional() }) + .optional() + + router.post( + "actionsReRunWorkflowFailedJobs", + "/repos/:owner/:repo/actions/runs/:runId/rerun-failed-jobs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsReRunWorkflowFailedJobsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsReRunWorkflowFailedJobsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsReRunWorkflowFailedJobs(input, ctx) + + ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetWorkflowRunUsageParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), }) router.get( - "reposListAutolinks", - "/repos/:owner/:repo/autolinks", + "actionsGetWorkflowRunUsage", + "/repos/:owner/:repo/actions/runs/:runId/timing", async (ctx, next) => { const input = { - params: parseRequestInput(reposListAutolinksParamSchema, ctx.params), - query: parseRequestInput(reposListAutolinksQuerySchema, ctx.query), + params: parseRequestInput( + actionsGetWorkflowRunUsageParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListAutolinks( + const { status, body } = await implementation.actionsGetWorkflowRunUsage( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }) - ) - .parse(body) - } - + billable: z.object({ + UBUNTU: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + MACOS: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + WINDOWS: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + }), + run_duration_ms: z.coerce.number().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateAutolinkParamSchema = z.object({ + const actionsListRepoSecretsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposCreateAutolinkBodySchema = z.object({ - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean().optional(), + const actionsListRepoSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "reposCreateAutolink", - "/repos/:owner/:repo/autolinks", + router.get( + "actionsListRepoSecrets", + "/repos/:owner/:repo/actions/secrets", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreateAutolinkParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateAutolinkBodySchema, ctx.body), + params: parseRequestInput( + actionsListRepoSecretsParamSchema, + ctx.params + ), + query: parseRequestInput(actionsListRepoSecretsQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposCreateAutolink( + const { status, body } = await implementation.actionsListRepoSecrets( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }) - ) - .optional(), - }) - .parse(body) - } - + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetAutolinkParamSchema = z.object({ + const actionsGetRepoPublicKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - autolink_id: z.coerce.number(), }) router.get( - "reposGetAutolink", - "/repos/:owner/:repo/autolinks/:autolinkId", + "actionsGetRepoPublicKey", + "/repos/:owner/:repo/actions/secrets/public-key", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetAutolinkParamSchema, ctx.params), + params: parseRequestInput( + actionsGetRepoPublicKeyParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetAutolink(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.actionsGetRepoPublicKey( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeleteAutolinkParamSchema = z.object({ + const actionsGetRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - autolink_id: z.coerce.number(), + secret_name: z.coerce.string(), }) - router.delete( - "reposDeleteAutolink", - "/repos/:owner/:repo/autolinks/:autolinkId", + router.get( + "actionsGetRepoSecret", + "/repos/:owner/:repo/actions/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeleteAutolinkParamSchema, ctx.params), + params: parseRequestInput(actionsGetRepoSecretParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposDeleteAutolink( + const { status, body } = await implementation.actionsGetRepoSecret( input, ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposEnableAutomatedSecurityFixesParamSchema = z.object({ + const actionsCreateOrUpdateRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const actionsCreateOrUpdateRepoSecretBodySchema = z.object({ + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string().optional(), }) router.put( - "reposEnableAutomatedSecurityFixes", - "/repos/:owner/:repo/automated-security-fixes", + "actionsCreateOrUpdateRepoSecret", + "/repos/:owner/:repo/actions/secrets/:secretName", async (ctx, next) => { const input = { params: parseRequestInput( - reposEnableAutomatedSecurityFixesParamSchema, + actionsCreateOrUpdateRepoSecretParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + actionsCreateOrUpdateRepoSecretBodySchema, + ctx.body + ), } const { status, body } = - await implementation.reposEnableAutomatedSecurityFixes(input, ctx) + await implementation.actionsCreateOrUpdateRepoSecret(input, ctx) + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDisableAutomatedSecurityFixesParamSchema = z.object({ + const actionsDeleteRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + secret_name: z.coerce.string(), }) router.delete( - "reposDisableAutomatedSecurityFixes", - "/repos/:owner/:repo/automated-security-fixes", + "actionsDeleteRepoSecret", + "/repos/:owner/:repo/actions/secrets/:secretName", async (ctx, next) => { const input = { params: parseRequestInput( - reposDisableAutomatedSecurityFixesParamSchema, + actionsDeleteRepoSecretParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.reposDisableAutomatedSecurityFixes(input, ctx) + const { status, body } = await implementation.actionsDeleteRepoSecret( + input, + ctx + ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposListBranchesParamSchema = z.object({ + const actionsListRepoVariablesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposListBranchesQuerySchema = z.object({ - protected: z.coerce.boolean().optional(), + const actionsListRepoVariablesQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "reposListBranches", - "/repos/:owner/:repo/branches", + "actionsListRepoVariables", + "/repos/:owner/:repo/actions/variables", async (ctx, next) => { const input = { - params: parseRequestInput(reposListBranchesParamSchema, ctx.params), - query: parseRequestInput(reposListBranchesQuerySchema, ctx.query), + params: parseRequestInput( + actionsListRepoVariablesParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListRepoVariablesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposListBranches( + const { status, body } = await implementation.actionsListRepoVariables( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsCreateRepoVariableParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsCreateRepoVariableBodySchema = z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + }) + + router.post( + "actionsCreateRepoVariable", + "/repos/:owner/:repo/actions/variables", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsCreateRepoVariableParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(actionsCreateRepoVariableBodySchema, ctx.body), + } + + const { status, body } = await implementation.actionsCreateRepoVariable( + input, + ctx + ) + + ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetRepoVariableParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + name: z.coerce.string(), + }) + + router.get( + "actionsGetRepoVariable", + "/repos/:owner/:repo/actions/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetRepoVariableParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetRepoVariable( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - protected: z.coerce.boolean(), - protection: z - .object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce - .number() - .optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce - .number() - .optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce - .number() - .optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }) - .optional(), - protection_url: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsUpdateRepoVariableParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + name: z.coerce.string(), + }) + + const actionsUpdateRepoVariableBodySchema = z.object({ + name: z.coerce.string().optional(), + value: z.coerce.string().optional(), + }) + + router.patch( + "actionsUpdateRepoVariable", + "/repos/:owner/:repo/actions/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsUpdateRepoVariableParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(actionsUpdateRepoVariableBodySchema, ctx.body), } + const { status, body } = await implementation.actionsUpdateRepoVariable( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetBranchParamSchema = z.object({ + const actionsDeleteRepoVariableParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + name: z.coerce.string(), }) - router.get( - "reposGetBranch", - "/repos/:owner/:repo/branches/:branch", + router.delete( + "actionsDeleteRepoVariable", + "/repos/:owner/:repo/actions/variables/:name", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetBranchParamSchema, ctx.params), + params: parseRequestInput( + actionsDeleteRepoVariableParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetBranch(input, ctx) + const { status, body } = await implementation.actionsDeleteRepoVariable( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsListRepoWorkflowsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsListRepoWorkflowsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListRepoWorkflows", + "/repos/:owner/:repo/actions/workflows", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListRepoWorkflowsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListRepoWorkflowsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.actionsListRepoWorkflows( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + workflows: z.array( z.object({ - sha: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), }) ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - _links: z.object({ - html: z.coerce.string(), - self: z.coerce.string(), }), - protected: z.coerce.boolean(), - protection: z.object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetWorkflowParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + }) + + router.get( + "actionsGetWorkflow", + "/repos/:owner/:repo/actions/workflows/:workflowId", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsGetWorkflowParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetWorkflow( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), }), - protection_url: z.coerce.string(), - pattern: z.coerce.string().optional(), - required_approving_review_count: z.coerce.number().optional(), - }) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDisableWorkflowParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + }) + + router.put( + "actionsDisableWorkflow", + "/repos/:owner/:repo/actions/workflows/:workflowId/disable", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDisableWorkflowParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = await implementation.actionsDisableWorkflow( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetBranchProtectionParamSchema = z.object({ + const actionsCreateWorkflowDispatchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - router.get( - "reposGetBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection", + const actionsCreateWorkflowDispatchBodySchema = z.object({ + ref: z.coerce.string(), + inputs: z.object({}).optional(), + }) + + router.post( + "actionsCreateWorkflowDispatch", + "/repos/:owner/:repo/actions/workflows/:workflowId/dispatches", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetBranchProtectionParamSchema, + actionsCreateWorkflowDispatchParamSchema, ctx.params ), query: undefined, + body: parseRequestInput( + actionsCreateWorkflowDispatchBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsCreateWorkflowDispatch(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsEnableWorkflowParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + }) + + router.put( + "actionsEnableWorkflow", + "/repos/:owner/:repo/actions/workflows/:workflowId/enable", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsEnableWorkflowParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetBranchProtection( + const { status, body } = await implementation.actionsEnableWorkflow( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposUpdateBranchProtectionParamSchema = z.object({ + const actionsListWorkflowRunsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - const reposUpdateBranchProtectionBodySchema = z.object({ - required_status_checks: z.object({ - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z - .array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number().optional(), - }) - ) - .optional(), - }), - enforce_admins: z.coerce.boolean(), - required_pull_request_reviews: z.object({ - dismissal_restrictions: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean().optional(), - require_code_owner_reviews: z.coerce.boolean().optional(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - bypass_pull_request_allowances: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - }), - restrictions: z.object({ - users: z.array(z.coerce.string()), - teams: z.array(z.coerce.string()), - apps: z.array(z.coerce.string()).optional(), - }), - required_linear_history: z.coerce.boolean().optional(), - allow_force_pushes: z.coerce.boolean().optional(), - allow_deletions: z.coerce.boolean().optional(), - block_creations: z.coerce.boolean().optional(), - required_conversation_resolution: z.coerce.boolean().optional(), - lock_branch: z.coerce.boolean().optional(), - allow_fork_syncing: z.coerce.boolean().optional(), + const actionsListWorkflowRunsQuerySchema = z.object({ + actor: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + event: z.coerce.string().optional(), + status: z + .enum([ + "completed", + "action_required", + "cancelled", + "failure", + "neutral", + "skipped", + "stale", + "success", + "timed_out", + "in_progress", + "queued", + "requested", + "waiting", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + created: z.coerce.string().datetime({ offset: true }).optional(), + exclude_pull_requests: z.coerce.boolean().optional(), + check_suite_id: z.coerce.number().optional(), + head_sha: z.coerce.string().optional(), }) - router.put( - "reposUpdateBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection", + router.get( + "actionsListWorkflowRuns", + "/repos/:owner/:repo/actions/workflows/:workflowId/runs", async (ctx, next) => { const input = { params: parseRequestInput( - reposUpdateBranchProtectionParamSchema, + actionsListWorkflowRunsParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - reposUpdateBranchProtectionBodySchema, - ctx.body - ), + query: parseRequestInput(actionsListWorkflowRunsQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposUpdateBranchProtection( + const { status, body } = await implementation.actionsListWorkflowRuns( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - required_status_checks: z - .object({ - url: z.coerce.string(), - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string(), - }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string(), - dismiss_stale_reviews: z.coerce.boolean().optional(), - require_code_owner_reviews: z.coerce.boolean().optional(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - dismissal_restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - users: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), }) - ), - teams: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), }), - }) - ), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), }), - }) - ), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - }) - .optional(), - required_signatures: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - enforce_admins: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeleteBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteBranchProtection( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetAdminBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetAdminBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAdminBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetAdminBranchProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposSetAdminBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.post( - "reposSetAdminBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetAdminBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposSetAdminBranchProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteAdminBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeleteAdminBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteAdminBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeleteAdminBranchProtection(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetPullRequestReviewProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetPullRequestReviewProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetPullRequestReviewProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetPullRequestReviewProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50526,116 +52159,16 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - teams: z - .array( - z.object({ + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), followers_url: z.coerce.string(), @@ -50651,171 +52184,39 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + email: z.coerce.string(), + }), + committer: z.object({ name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUpdatePullRequestReviewProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposUpdatePullRequestReviewProtectionBodySchema = z - .object({ - dismissal_restrictions: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean().optional(), - require_code_owner_reviews: z.coerce.boolean().optional(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - bypass_pull_request_allowances: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - }) - .optional() - - router.patch( - "reposUpdatePullRequestReviewProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdatePullRequestReviewProtectionParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdatePullRequestReviewProtectionBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdatePullRequestReviewProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50837,110 +52238,147 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50962,231 +52400,290 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), }) - ) - .optional(), - }) - .parse(body) - } - + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeletePullRequestReviewProtectionParamSchema = z.object({ + const actionsGetWorkflowUsageParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - router.delete( - "reposDeletePullRequestReviewProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", + router.get( + "actionsGetWorkflowUsage", + "/repos/:owner/:repo/actions/workflows/:workflowId/timing", async (ctx, next) => { const input = { params: parseRequestInput( - reposDeletePullRequestReviewProtectionParamSchema, + actionsGetWorkflowUsageParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.reposDeletePullRequestReviewProtection(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.actionsGetWorkflowUsage( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + billable: z.object({ + UBUNTU: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + MACOS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + WINDOWS: z + .object({ total_ms: z.coerce.number().optional() }) + .optional(), + }), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetCommitSignatureProtectionParamSchema = z.object({ + const issuesListAssigneesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + }) + + const issuesListAssigneesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetCommitSignatureProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_signatures", + "issuesListAssignees", + "/repos/:owner/:repo/assignees", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetCommitSignatureProtectionParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(issuesListAssigneesParamSchema, ctx.params), + query: parseRequestInput(issuesListAssigneesQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposGetCommitSignatureProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.issuesListAssignees( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateCommitSignatureProtectionParamSchema = z.object({ + const issuesCheckUserCanBeAssignedParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + assignee: z.coerce.string(), }) - router.post( - "reposCreateCommitSignatureProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_signatures", + router.get( + "issuesCheckUserCanBeAssigned", + "/repos/:owner/:repo/assignees/:assignee", async (ctx, next) => { const input = { params: parseRequestInput( - reposCreateCommitSignatureProtectionParamSchema, + issuesCheckUserCanBeAssignedParamSchema, ctx.params ), query: undefined, @@ -51194,253 +52691,240 @@ export function bootstrap( } const { status, body } = - await implementation.reposCreateCommitSignatureProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.issuesCheckUserCanBeAssigned(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeleteCommitSignatureProtectionParamSchema = z.object({ + const reposListAutolinksParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), }) - router.delete( - "reposDeleteCommitSignatureProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_signatures", + const reposListAutolinksQuerySchema = z.object({ + page: z.coerce.number().optional(), + }) + + router.get( + "reposListAutolinks", + "/repos/:owner/:repo/autolinks", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDeleteCommitSignatureProtectionParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(reposListAutolinksParamSchema, ctx.params), + query: parseRequestInput(reposListAutolinksQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposDeleteCommitSignatureProtection(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.reposListAutolinks( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetStatusChecksProtectionParamSchema = z.object({ + const reposCreateAutolinkParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), }) - router.get( - "reposGetStatusChecksProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + const reposCreateAutolinkBodySchema = z.object({ + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateAutolink", + "/repos/:owner/:repo/autolinks", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetStatusChecksProtectionParamSchema, - ctx.params - ), + params: parseRequestInput(reposCreateAutolinkParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(reposCreateAutolinkBodySchema, ctx.body), } - const { status, body } = - await implementation.reposGetStatusChecksProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.reposCreateAutolink( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposUpdateStatusCheckProtectionParamSchema = z.object({ + const reposGetAutolinkParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + autolink_id: z.coerce.number(), }) - const reposUpdateStatusCheckProtectionBodySchema = z - .object({ - strict: z.coerce.boolean().optional(), - contexts: z.array(z.coerce.string()).optional(), - checks: z - .array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number().optional(), - }) - ) - .optional(), - }) - .optional() - - router.patch( - "reposUpdateStatusCheckProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + router.get( + "reposGetAutolink", + "/repos/:owner/:repo/autolinks/:autolinkId", async (ctx, next) => { const input = { - params: parseRequestInput( - reposUpdateStatusCheckProtectionParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetAutolinkParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - reposUpdateStatusCheckProtectionBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = - await implementation.reposUpdateStatusCheckProtection(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = await implementation.reposGetAutolink(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposRemoveStatusCheckProtectionParamSchema = z.object({ + const reposDeleteAutolinkParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + autolink_id: z.coerce.number(), }) router.delete( - "reposRemoveStatusCheckProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + "reposDeleteAutolink", + "/repos/:owner/:repo/autolinks/:autolinkId", async (ctx, next) => { const input = { - params: parseRequestInput( - reposRemoveStatusCheckProtectionParamSchema, - ctx.params - ), + params: parseRequestInput(reposDeleteAutolinkParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.reposRemoveStatusCheckProtection(input, ctx) + const { status, body } = await implementation.reposDeleteAutolink( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetAllStatusCheckContextsParamSchema = z.object({ + const reposEnableAutomatedSecurityFixesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), }) - router.get( - "reposGetAllStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + router.put( + "reposEnableAutomatedSecurityFixes", + "/repos/:owner/:repo/automated-security-fixes", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetAllStatusCheckContextsParamSchema, + reposEnableAutomatedSecurityFixesParamSchema, ctx.params ), query: undefined, @@ -51448,854 +52932,2182 @@ export function bootstrap( } const { status, body } = - await implementation.reposGetAllStatusCheckContexts(input, ctx) - - if (status === 200) { - ctx.body = z.array(z.coerce.string()).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.reposEnableAutomatedSecurityFixes(input, ctx) - ctx.status = status - return next() - } - ) - - const reposAddStatusCheckContextsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposAddStatusCheckContextsBodySchema = z.union([ - z.object({ contexts: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposAddStatusCheckContextsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposAddStatusCheckContextsBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposAddStatusCheckContexts( - input, - ctx - ) - - if (status === 200) { - ctx.body = z.array(z.coerce.string()).parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposSetStatusCheckContextsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposSetStatusCheckContextsBodySchema = z.union([ - z.object({ contexts: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetStatusCheckContextsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposSetStatusCheckContextsBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposSetStatusCheckContexts( - input, - ctx + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body ) - - if (status === 200) { - ctx.body = z.array(z.coerce.string()).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - ctx.status = status return next() } ) - const reposRemoveStatusCheckContextsParamSchema = z.object({ + const reposDisableAutomatedSecurityFixesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), }) - const reposRemoveStatusCheckContextsBodySchema = z.union([ - z.object({ contexts: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - router.delete( - "reposRemoveStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + "reposDisableAutomatedSecurityFixes", + "/repos/:owner/:repo/automated-security-fixes", async (ctx, next) => { const input = { params: parseRequestInput( - reposRemoveStatusCheckContextsParamSchema, + reposDisableAutomatedSecurityFixesParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposRemoveStatusCheckContextsBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.reposRemoveStatusCheckContexts(input, ctx) - - if (status === 200) { - ctx.body = z.array(z.coerce.string()).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + await implementation.reposDisableAutomatedSecurityFixes(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetAccessRestrictionsParamSchema = z.object({ + const reposListBranchesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - branch: z.coerce.string(), + }) + + const reposListBranchesQuerySchema = z.object({ + protected: z.coerce.boolean().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions", + "reposListBranches", + "/repos/:owner/:repo/branches", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(reposListBranchesParamSchema, ctx.params), + query: parseRequestInput(reposListBranchesQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposGetAccessRestrictions( + const { status, body } = await implementation.reposListBranches( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + protected: z.coerce.boolean(), + protection: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce + .number() + .optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce + .number() + .optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce + .number() + .optional(), + require_last_push_approval: z.coerce + .boolean() + .optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce + .string() + .optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), }) .optional(), - events: z.array(z.coerce.string()).optional(), + protection_url: z.coerce.string().optional(), }) ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeleteAccessRestrictionsParamSchema = z.object({ + const reposGetBranchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - router.delete( - "reposDeleteAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions", + router.get( + "reposGetBranch", + "/repos/:owner/:repo/branches/:branch", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDeleteAccessRestrictionsParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetBranchParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.reposDeleteAccessRestrictions(input, ctx) - - ctx.status = status - return next() - } - ) - - const reposGetAppsWithAccessToProtectedBranchParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) + const { status, body } = await implementation.reposGetBranch(input, ctx) - router.get( - "reposGetAppsWithAccessToProtectedBranch", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAppsWithAccessToProtectedBranchParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetAppsWithAccessToProtectedBranch(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + commit: z.object({ url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), + _links: z.object({ + html: z.coerce.string(), + self: z.coerce.string(), }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + protected: z.coerce.boolean(), + protection: z.object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce + .number() + .optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }), + protection_url: z.coerce.string(), + pattern: z.coerce.string().optional(), + required_approving_review_count: z.coerce.number().optional(), + }), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposAddAppAccessRestrictionsParamSchema = z.object({ + const reposGetBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposAddAppAccessRestrictionsBodySchema = z.union([ - z.object({ apps: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddAppAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + router.get( + "reposGetBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection", async (ctx, next) => { const input = { params: parseRequestInput( - reposAddAppAccessRestrictionsParamSchema, + reposGetBranchProtectionParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposAddAppAccessRestrictionsBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = - await implementation.reposAddAppAccessRestrictions(input, ctx) + const { status, body } = await implementation.reposGetBranchProtection( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposSetAppAccessRestrictionsParamSchema = z.object({ + const reposUpdateBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposSetAppAccessRestrictionsBodySchema = z.union([ - z.object({ apps: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) + const reposUpdateBranchProtectionBodySchema = z.object({ + required_status_checks: z.object({ + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z + .array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number().optional(), + }) + ) + .optional(), + }), + enforce_admins: z.coerce.boolean(), + required_pull_request_reviews: z.object({ + dismissal_restrictions: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + }), + restrictions: z.object({ + users: z.array(z.coerce.string()), + teams: z.array(z.coerce.string()), + apps: z.array(z.coerce.string()).optional(), + }), + required_linear_history: z.coerce.boolean().optional(), + allow_force_pushes: z.coerce.boolean().optional(), + allow_deletions: z.coerce.boolean().optional(), + block_creations: z.coerce.boolean().optional(), + required_conversation_resolution: z.coerce.boolean().optional(), + lock_branch: z.coerce.boolean().optional(), + allow_fork_syncing: z.coerce.boolean().optional(), + }) router.put( - "reposSetAppAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + "reposUpdateBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection", async (ctx, next) => { const input = { params: parseRequestInput( - reposSetAppAccessRestrictionsParamSchema, + reposUpdateBranchProtectionParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - reposSetAppAccessRestrictionsBodySchema, + reposUpdateBranchProtectionBodySchema, ctx.body ), } - const { status, body } = - await implementation.reposSetAppAccessRestrictions(input, ctx) + const { status, body } = await implementation.reposUpdateBranchProtection( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + url: z.coerce.string(), + required_status_checks: z + .object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + dismissal_restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + }) + .optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposRemoveAppAccessRestrictionsParamSchema = z.object({ + const reposDeleteBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposRemoveAppAccessRestrictionsBodySchema = z.union([ - z.object({ apps: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - router.delete( - "reposRemoveAppAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + "reposDeleteBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection", async (ctx, next) => { const input = { params: parseRequestInput( - reposRemoveAppAccessRestrictionsParamSchema, + reposDeleteBranchProtectionParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposRemoveAppAccessRestrictionsBodySchema, - ctx.body + body: undefined, + } + + const { status, body } = await implementation.reposDeleteBranchProtection( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetAdminBranchProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetAdminBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetAdminBranchProtectionParamSchema, + ctx.params ), + query: undefined, + body: undefined, } const { status, body } = - await implementation.reposRemoveAppAccessRestrictions(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + await implementation.reposGetAdminBranchProtection(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetTeamsWithAccessToProtectedBranchParamSchema = z.object({ + const reposSetAdminBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - router.get( - "reposGetTeamsWithAccessToProtectedBranch", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + router.post( + "reposSetAdminBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetTeamsWithAccessToProtectedBranchParamSchema, + reposSetAdminBranchProtectionParamSchema, ctx.params ), query: undefined, @@ -52303,384 +55115,720 @@ export function bootstrap( } const { status, body } = - await implementation.reposGetTeamsWithAccessToProtectedBranch( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.reposSetAdminBranchProtection(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposAddTeamAccessRestrictionsParamSchema = z.object({ + const reposDeleteAdminBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposAddTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddTeamAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + router.delete( + "reposDeleteAdminBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", async (ctx, next) => { const input = { params: parseRequestInput( - reposAddTeamAccessRestrictionsParamSchema, + reposDeleteAdminBranchProtectionParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposAddTeamAccessRestrictionsBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.reposAddTeamAccessRestrictions(input, ctx) + await implementation.reposDeleteAdminBranchProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposSetTeamAccessRestrictionsParamSchema = z.object({ + const reposGetPullRequestReviewProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposSetTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetTeamAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + router.get( + "reposGetPullRequestReviewProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", async (ctx, next) => { const input = { params: parseRequestInput( - reposSetTeamAccessRestrictionsParamSchema, + reposGetPullRequestReviewProtectionParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposSetTeamAccessRestrictionsBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.reposSetTeamAccessRestrictions(input, ctx) + await implementation.reposGetPullRequestReviewProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z + url: z.coerce.string().optional(), + dismissal_restrictions: z .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), }) .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposRemoveTeamAccessRestrictionsParamSchema = z.object({ + const reposUpdatePullRequestReviewProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposRemoveTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.delete( - "reposRemoveTeamAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", - async (ctx, next) => { - const input = { + const reposUpdatePullRequestReviewProtectionBodySchema = z + .object({ + dismissal_restrictions: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + }) + .optional() + + router.patch( + "reposUpdatePullRequestReviewProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", + async (ctx, next) => { + const input = { params: parseRequestInput( - reposRemoveTeamAccessRestrictionsParamSchema, + reposUpdatePullRequestReviewProtectionParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - reposRemoveTeamAccessRestrictionsBodySchema, + reposUpdatePullRequestReviewProtectionBodySchema, ctx.body ), } const { status, body } = - await implementation.reposRemoveTeamAccessRestrictions(input, ctx) + await implementation.reposUpdatePullRequestReviewProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z + url: z.coerce.string().optional(), + dismissal_restrictions: z .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), }) .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetUsersWithAccessToProtectedBranchParamSchema = z.object({ + const reposDeletePullRequestReviewProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - router.get( - "reposGetUsersWithAccessToProtectedBranch", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + router.delete( + "reposDeletePullRequestReviewProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetUsersWithAccessToProtectedBranchParamSchema, + reposDeletePullRequestReviewProtectionParamSchema, ctx.params ), query: undefined, @@ -52688,769 +55836,709 @@ export function bootstrap( } const { status, body } = - await implementation.reposGetUsersWithAccessToProtectedBranch( - input, - ctx - ) + await implementation.reposDeletePullRequestReviewProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposAddUserAccessRestrictionsParamSchema = z.object({ + const reposGetCommitSignatureProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposAddUserAccessRestrictionsBodySchema = z.union([ - z.object({ users: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddUserAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + router.get( + "reposGetCommitSignatureProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_signatures", async (ctx, next) => { const input = { params: parseRequestInput( - reposAddUserAccessRestrictionsParamSchema, + reposGetCommitSignatureProtectionParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposAddUserAccessRestrictionsBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.reposAddUserAccessRestrictions(input, ctx) + await implementation.reposGetCommitSignatureProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), + ], + [ + "404", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposSetUserAccessRestrictionsParamSchema = z.object({ + const reposCreateCommitSignatureProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposSetUserAccessRestrictionsBodySchema = z.union([ - z.object({ users: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetUserAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + router.post( + "reposCreateCommitSignatureProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_signatures", async (ctx, next) => { const input = { params: parseRequestInput( - reposSetUserAccessRestrictionsParamSchema, + reposCreateCommitSignatureProtectionParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposSetUserAccessRestrictionsBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.reposSetUserAccessRestrictions(input, ctx) + await implementation.reposCreateCommitSignatureProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), + ], + [ + "404", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteCommitSignatureProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.delete( + "reposDeleteCommitSignatureProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_signatures", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDeleteCommitSignatureProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.reposDeleteCommitSignatureProtection(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposRemoveUserAccessRestrictionsParamSchema = z.object({ + const reposGetStatusChecksProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposRemoveUserAccessRestrictionsBodySchema = z.union([ - z.object({ users: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) + router.get( + "reposGetStatusChecksProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetStatusChecksProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - router.delete( - "reposRemoveUserAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + const { status, body } = + await implementation.reposGetStatusChecksProtection(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateStatusCheckProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposUpdateStatusCheckProtectionBodySchema = z + .object({ + strict: z.coerce.boolean().optional(), + contexts: z.array(z.coerce.string()).optional(), + checks: z + .array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number().optional(), + }) + ) + .optional(), + }) + .optional() + + router.patch( + "reposUpdateStatusCheckProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", async (ctx, next) => { const input = { params: parseRequestInput( - reposRemoveUserAccessRestrictionsParamSchema, + reposUpdateStatusCheckProtectionParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - reposRemoveUserAccessRestrictionsBodySchema, + reposUpdateStatusCheckProtectionBodySchema, ctx.body ), } const { status, body } = - await implementation.reposRemoveUserAccessRestrictions(input, ctx) + await implementation.reposUpdateStatusCheckProtection(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + context: z.coerce.string(), + app_id: z.coerce.number(), }) - ) - .optional(), - }) - .parse(body) + ), + contexts_url: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveStatusCheckProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.delete( + "reposRemoveStatusCheckProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveStatusCheckProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.reposRemoveStatusCheckProtection(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposRenameBranchParamSchema = z.object({ + const reposGetAllStatusCheckContextsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - const reposRenameBranchBodySchema = z.object({ new_name: z.coerce.string() }) + router.get( + "reposGetAllStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetAllStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetAllStatusCheckContexts(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposAddStatusCheckContextsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposAddStatusCheckContextsBodySchema = z.union([ + z.object({ contexts: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) router.post( - "reposRenameBranch", - "/repos/:owner/:repo/branches/:branch/rename", + "reposAddStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", async (ctx, next) => { const input = { - params: parseRequestInput(reposRenameBranchParamSchema, ctx.params), + params: parseRequestInput( + reposAddStatusCheckContextsParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(reposRenameBranchBodySchema, ctx.body), + body: parseRequestInput( + reposAddStatusCheckContextsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposRenameBranch( + const { status, body } = await implementation.reposAddStatusCheckContexts( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - name: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) + ) .optional(), - files: z + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposSetStatusCheckContextsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposSetStatusCheckContextsBodySchema = z.union([ + z.object({ contexts: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.put( + "reposSetStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposSetStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposSetStatusCheckContextsBodySchema, + ctx.body + ), + } + + const { status, body } = await implementation.reposSetStatusCheckContexts( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z .array( z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), }) ) .optional(), }), - _links: z.object({ - html: z.coerce.string(), - self: z.coerce.string(), - }), - protected: z.coerce.boolean(), - protection: z.object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveStatusCheckContextsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveStatusCheckContextsBodySchema = z.union([ + z.object({ contexts: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveStatusCheckContextsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposRemoveStatusCheckContexts(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - required_pull_request_reviews: z - .object({ + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetAccessRestrictions( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ login: z.coerce.string().optional(), id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), html_url: z.coerce.string().optional(), followers_url: z.coerce.string().optional(), following_url: z.coerce.string().optional(), @@ -53458,1274 +56546,944 @@ export function bootstrap( starred_url: z.coerce.string().optional(), subscriptions_url: z.coerce.string().optional(), organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), received_events_url: z.coerce.string().optional(), type: z.coerce.string().optional(), site_admin: z.coerce.boolean().optional(), }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), }) - ), + .optional(), + events: z.array(z.coerce.string()).optional(), }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), + ), }), - protection_url: z.coerce.string(), - pattern: z.coerce.string().optional(), - required_approving_review_count: z.coerce.number().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksCreateParamSchema = z.object({ + const reposDeleteAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) - const checksCreateBodySchema = z.union([ - z.object({ status: z.object({}) }), - z.object({ status: z.object({}).optional() }), - ]) - - router.post( - "checksCreate", - "/repos/:owner/:repo/check-runs", + router.delete( + "reposDeleteAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions", async (ctx, next) => { const input = { - params: parseRequestInput(checksCreateParamSchema, ctx.params), + params: parseRequestInput( + reposDeleteAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(checksCreateBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.checksCreate(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposDeleteAccessRestrictions(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const checksGetParamSchema = z.object({ + const reposGetAppsWithAccessToProtectedBranchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - check_run_id: z.coerce.number(), + branch: z.coerce.string(), }) router.get( - "checksGet", - "/repos/:owner/:repo/check-runs/:checkRunId", + "reposGetAppsWithAccessToProtectedBranch", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", async (ctx, next) => { const input = { - params: parseRequestInput(checksGetParamSchema, ctx.params), + params: parseRequestInput( + reposGetAppsWithAccessToProtectedBranchParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.checksGet(input, ctx) + const { status, body } = + await implementation.reposGetAppsWithAccessToProtectedBranch(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - .optional(), - }) - .parse(body) - } - + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksUpdateParamSchema = z.object({ + const reposAddAppAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - check_run_id: z.coerce.number(), + branch: z.coerce.string(), }) - const checksUpdateBodySchema = z.object({ - name: z.coerce.string().optional(), - details_url: z.coerce.string().optional(), - external_id: z.coerce.string().optional(), - started_at: z.coerce.string().datetime({ offset: true }).optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - conclusion: z - .enum([ - "action_required", - "cancelled", - "failure", - "neutral", - "success", - "skipped", - "stale", - "timed_out", - ]) - .optional(), - completed_at: z.coerce.string().datetime({ offset: true }).optional(), - output: z - .object({ - title: z.coerce.string().optional(), - summary: z.coerce.string(), - text: z.coerce.string().optional(), - annotations: z - .array( - z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - annotation_level: z.enum(["notice", "warning", "failure"]), - message: z.coerce.string(), - title: z.coerce.string().optional(), - raw_details: z.coerce.string().optional(), - }) - ) - .optional(), - images: z - .array( - z.object({ - alt: z.coerce.string(), - image_url: z.coerce.string(), - caption: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - actions: z - .array( - z.object({ - label: z.coerce.string(), - description: z.coerce.string(), - identifier: z.coerce.string(), - }) - ) - .optional(), - }) + const reposAddAppAccessRestrictionsBodySchema = z.union([ + z.object({ apps: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) - router.patch( - "checksUpdate", - "/repos/:owner/:repo/check-runs/:checkRunId", + router.post( + "reposAddAppAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", async (ctx, next) => { const input = { - params: parseRequestInput(checksUpdateParamSchema, ctx.params), + params: parseRequestInput( + reposAddAppAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(checksUpdateBodySchema, ctx.body), + body: parseRequestInput( + reposAddAppAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.checksUpdate(input, ctx) + const { status, body } = + await implementation.reposAddAppAccessRestrictions(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - .optional(), - }) - .parse(body) - } - + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksListAnnotationsParamSchema = z.object({ + const reposSetAppAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - check_run_id: z.coerce.number(), + branch: z.coerce.string(), }) - const checksListAnnotationsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const reposSetAppAccessRestrictionsBodySchema = z.union([ + z.object({ apps: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) - router.get( - "checksListAnnotations", - "/repos/:owner/:repo/check-runs/:checkRunId/annotations", + router.put( + "reposSetAppAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", async (ctx, next) => { const input = { - params: parseRequestInput(checksListAnnotationsParamSchema, ctx.params), - query: parseRequestInput(checksListAnnotationsQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput( + reposSetAppAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposSetAppAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.checksListAnnotations( - input, - ctx - ) + const { status, body } = + await implementation.reposSetAppAccessRestrictions(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + [ + "422", z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number(), - end_column: z.coerce.number(), - annotation_level: z.coerce.string(), - title: z.coerce.string(), message: z.coerce.string(), - raw_details: z.coerce.string(), - blob_href: z.coerce.string(), - }) - ) - .parse(body) + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveAppAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveAppAccessRestrictionsBodySchema = z.union([ + z.object({ apps: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveAppAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveAppAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveAppAccessRestrictionsBodySchema, + ctx.body + ), } + const { status, body } = + await implementation.reposRemoveAppAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksRerequestRunParamSchema = z.object({ + const reposGetTeamsWithAccessToProtectedBranchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - check_run_id: z.coerce.number(), + branch: z.coerce.string(), }) - router.post( - "checksRerequestRun", - "/repos/:owner/:repo/check-runs/:checkRunId/rerequest", + router.get( + "reposGetTeamsWithAccessToProtectedBranch", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", async (ctx, next) => { const input = { - params: parseRequestInput(checksRerequestRunParamSchema, ctx.params), + params: parseRequestInput( + reposGetTeamsWithAccessToProtectedBranchParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.checksRerequestRun( - input, - ctx - ) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposGetTeamsWithAccessToProtectedBranch( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksCreateSuiteParamSchema = z.object({ + const reposAddTeamAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) - const checksCreateSuiteBodySchema = z.object({ head_sha: z.coerce.string() }) + const reposAddTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) router.post( - "checksCreateSuite", - "/repos/:owner/:repo/check-suites", + "reposAddTeamAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", async (ctx, next) => { const input = { - params: parseRequestInput(checksCreateSuiteParamSchema, ctx.params), + params: parseRequestInput( + reposAddTeamAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(checksCreateSuiteBodySchema, ctx.body), + body: parseRequestInput( + reposAddTeamAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.checksCreateSuite( - input, - ctx - ) + const { status, body } = + await implementation.reposAddTeamAccessRestrictions(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - number: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), }), }) ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposSetTeamAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposSetTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.put( + "reposSetTeamAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposSetTeamAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposSetTeamAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposSetTeamAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + [ + "422", + z.object({ message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveTeamAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveTeamAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveTeamAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveTeamAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposRemoveTeamAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - number: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), }), }) ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetUsersWithAccessToProtectedBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetUsersWithAccessToProtectedBranch", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetUsersWithAccessToProtectedBranchParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetUsersWithAccessToProtectedBranch( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -54747,33 +57505,62 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposAddUserAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposAddUserAccessRestrictionsBodySchema = z.union([ + z.object({ users: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.post( + "reposAddUserAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposAddUserAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposAddUserAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposAddUserAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -54795,220 +57582,76 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), + }) + ), + ], + [ + "422", + z.object({ message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksSetSuitesPreferencesParamSchema = z.object({ + const reposSetUserAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) - const checksSetSuitesPreferencesBodySchema = z.object({ - auto_trigger_checks: z - .array( - z.object({ app_id: z.coerce.number(), setting: z.coerce.boolean() }) - ) - .optional(), - }) + const reposSetUserAccessRestrictionsBodySchema = z.union([ + z.object({ users: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) - router.patch( - "checksSetSuitesPreferences", - "/repos/:owner/:repo/check-suites/preferences", + router.put( + "reposSetUserAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", async (ctx, next) => { const input = { params: parseRequestInput( - checksSetSuitesPreferencesParamSchema, + reposSetUserAccessRestrictionsParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(checksSetSuitesPreferencesBodySchema, ctx.body), + body: parseRequestInput( + reposSetUserAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.checksSetSuitesPreferences( - input, - ctx - ) + const { status, body } = + await implementation.reposSetUserAccessRestrictions(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - preferences: z.object({ - auto_trigger_checks: z - .array( - z.object({ - app_id: z.coerce.number(), - setting: z.coerce.boolean(), - }) - ) - .optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -55030,221 +57673,76 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksGetSuiteParamSchema = z.object({ + const reposRemoveUserAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - check_suite_id: z.coerce.number(), + branch: z.coerce.string(), }) - router.get( - "checksGetSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId", + const reposRemoveUserAccessRestrictionsBodySchema = z.union([ + z.object({ users: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveUserAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", async (ctx, next) => { const input = { - params: parseRequestInput(checksGetSuiteParamSchema, ctx.params), + params: parseRequestInput( + reposRemoveUserAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + reposRemoveUserAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.checksGetSuite(input, ctx) + const { status, body } = + await implementation.reposRemoveUserAccessRestrictions(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -55266,1649 +57764,1512 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRenameBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRenameBranchBodySchema = z.object({ new_name: z.coerce.string() }) + + router.post( + "reposRenameBranch", + "/repos/:owner/:repo/branches/:branch/rename", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposRenameBranchParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposRenameBranchBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposRenameBranch( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + commit: z.object({ url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), }) .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const checksListForSuiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_suite_id: z.coerce.number(), - }) - - const checksListForSuiteQuerySchema = z.object({ - check_name: z.coerce.string().optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - filter: z.enum(["latest", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "checksListForSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId/check-runs", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksListForSuiteParamSchema, ctx.params), - query: parseRequestInput(checksListForSuiteQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListForSuite( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - check_runs: z.array( - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - pull_requests: z.array( + parents: z.array( z.object({ - id: z.coerce.number(), - number: z.coerce.number(), + sha: z.coerce.string(), url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), + html_url: z.coerce.string().optional(), }) ), - deployment: z + stats: z .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), }) .optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const checksRerequestSuiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_suite_id: z.coerce.number(), - }) - - router.post( - "checksRerequestSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId/rerequest", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksRerequestSuiteParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.checksRerequestSuite( - input, - ctx - ) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const codeScanningListAlertsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codeScanningListAlertsForRepoQuerySchema = z.object({ - tool_name: z.coerce.string().optional(), - tool_guid: z.coerce.string().optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - direction: z.enum(["asc", "desc"]).optional(), - sort: z.enum(["created", "updated"]).optional(), - state: z.enum(["open", "closed", "dismissed", "fixed"]).optional(), - severity: z - .enum(["critical", "high", "medium", "low", "warning", "note", "error"]) - .optional(), - }) - - router.get( - "codeScanningListAlertsForRepo", - "/repos/:owner/:repo/code-scanning/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListAlertsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListAlertsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListAlertsForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce.string().datetime({ offset: true }).optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - severity: z - .enum(["none", "note", "warning", "error"]) + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) .optional(), - description: z.coerce.string().optional(), }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), + _links: z.object({ + html: z.coerce.string(), + self: z.coerce.string(), }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) + protected: z.coerce.boolean(), + protection: z.object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) + enforce_admins: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) .optional(), - location: z + required_pull_request_reviews: z .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce + .number() + .optional(), + require_last_push_approval: z.coerce.boolean().optional(), }) .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) .optional(), }), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codeScanningGetAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - router.get( - "codeScanningGetAlert", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(codeScanningGetAlertParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codeScanningGetAlert( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce.string().datetime({ offset: true }).optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + protection_url: z.coerce.string(), + pattern: z.coerce.string().optional(), + required_approving_review_count: z.coerce.number().optional(), }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - severity: z.enum(["none", "note", "warning", "error"]).optional(), - security_severity_level: z - .enum(["low", "medium", "high", "critical"]) - .optional(), - description: z.coerce.string().optional(), - full_description: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - help: z.coerce.string().optional(), - help_uri: z.coerce.string().optional(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), }), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codeScanningUpdateAlertParamSchema = z.object({ + const checksCreateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - alert_number: z.coerce.number(), }) - const codeScanningUpdateAlertBodySchema = z.object({ - state: z.enum(["open", "dismissed"]), - dismissed_reason: z - .enum(["null", "false positive", "won't fix", "used in tests"]) - .optional(), - dismissed_comment: z.coerce.string().optional(), - }) + const checksCreateBodySchema = z.union([ + z.object({ status: z.object({}) }), + z.object({ status: z.object({}).optional() }), + ]) - router.patch( - "codeScanningUpdateAlert", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", + router.post( + "checksCreate", + "/repos/:owner/:repo/check-runs", async (ctx, next) => { const input = { - params: parseRequestInput( - codeScanningUpdateAlertParamSchema, - ctx.params - ), + params: parseRequestInput(checksCreateParamSchema, ctx.params), query: undefined, - body: parseRequestInput(codeScanningUpdateAlertBodySchema, ctx.body), + body: parseRequestInput(checksCreateBodySchema, ctx.body), } - const { status, body } = await implementation.codeScanningUpdateAlert( - input, - ctx - ) + const { status, body } = await implementation.checksCreate(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce.string().datetime({ offset: true }).optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), + head_sha: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + external_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - severity: z.enum(["none", "note", "warning", "error"]).optional(), - security_severity_level: z - .enum(["low", "medium", "high", "critical"]) - .optional(), - description: z.coerce.string().optional(), - full_description: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - help: z.coerce.string().optional(), - help_uri: z.coerce.string().optional(), - }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codeScanningListAlertInstancesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const codeScanningListAlertInstancesQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - }) - - router.get( - "codeScanningListAlertInstances", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber/instances", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListAlertInstancesParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListAlertInstancesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListAlertInstances(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), }) .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codeScanningListRecentAnalysesParamSchema = z.object({ + const checksGetParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const codeScanningListRecentAnalysesQuerySchema = z.object({ - tool_name: z.coerce.string().optional(), - tool_guid: z.coerce.string().optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - sarif_id: z.coerce.string().optional(), - direction: z.enum(["asc", "desc"]).optional(), - sort: z.enum(["created"]).optional(), + check_run_id: z.coerce.number(), }) router.get( - "codeScanningListRecentAnalyses", - "/repos/:owner/:repo/code-scanning/analyses", + "checksGet", + "/repos/:owner/:repo/check-runs/:checkRunId", async (ctx, next) => { const input = { - params: parseRequestInput( - codeScanningListRecentAnalysesParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListRecentAnalysesQuerySchema, - ctx.query - ), + params: parseRequestInput(checksGetParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = - await implementation.codeScanningListRecentAnalyses(input, ctx) + const { status, body } = await implementation.checksGet(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - ref: z.coerce.string(), - commit_sha: z.coerce.string(), - analysis_key: z.coerce.string(), - environment: z.coerce.string(), - category: z.coerce.string().optional(), - error: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - results_count: z.coerce.number(), - rules_count: z.coerce.number(), id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), url: z.coerce.string(), - sarif_id: z.coerce.string(), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), }), - deletable: z.coerce.boolean(), - warning: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codeScanningGetAnalysisParamSchema = z.object({ + const checksUpdateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - analysis_id: z.coerce.number(), + check_run_id: z.coerce.number(), }) - router.get( - "codeScanningGetAnalysis", - "/repos/:owner/:repo/code-scanning/analyses/:analysisId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningGetAnalysisParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codeScanningGetAnalysis( - input, - ctx + const checksUpdateBodySchema = z.object({ + name: z.coerce.string().optional(), + details_url: z.coerce.string().optional(), + external_id: z.coerce.string().optional(), + started_at: z.coerce.string().datetime({ offset: true }).optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + conclusion: z + .enum([ + "action_required", + "cancelled", + "failure", + "neutral", + "success", + "skipped", + "stale", + "timed_out", + ]) + .optional(), + completed_at: z.coerce.string().datetime({ offset: true }).optional(), + output: z + .object({ + title: z.coerce.string().optional(), + summary: z.coerce.string(), + text: z.coerce.string().optional(), + annotations: z + .array( + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + annotation_level: z.enum(["notice", "warning", "failure"]), + message: z.coerce.string(), + title: z.coerce.string().optional(), + raw_details: z.coerce.string().optional(), + }) + ) + .optional(), + images: z + .array( + z.object({ + alt: z.coerce.string(), + image_url: z.coerce.string(), + caption: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + actions: z + .array( + z.object({ + label: z.coerce.string(), + description: z.coerce.string(), + identifier: z.coerce.string(), + }) ) - - if (status === 200) { - ctx.body = z.object({}).parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codeScanningDeleteAnalysisParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - analysis_id: z.coerce.number(), - }) - - const codeScanningDeleteAnalysisQuerySchema = z.object({ - confirm_delete: z.coerce.string().optional(), + .optional(), }) - router.delete( - "codeScanningDeleteAnalysis", - "/repos/:owner/:repo/code-scanning/analyses/:analysisId", + router.patch( + "checksUpdate", + "/repos/:owner/:repo/check-runs/:checkRunId", async (ctx, next) => { const input = { - params: parseRequestInput( - codeScanningDeleteAnalysisParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningDeleteAnalysisQuerySchema, - ctx.query - ), - body: undefined, + params: parseRequestInput(checksUpdateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(checksUpdateBodySchema, ctx.body), } - const { status, body } = await implementation.codeScanningDeleteAnalysis( - input, - ctx - ) + const { status, body } = await implementation.checksUpdate(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - next_analysis_url: z.coerce.string(), - confirm_delete_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codeScanningListCodeqlDatabasesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "codeScanningListCodeqlDatabases", - "/repos/:owner/:repo/code-scanning/codeql/databases", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListCodeqlDatabasesParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListCodeqlDatabases(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), name: z.coerce.string(), - language: z.coerce.string(), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }), - content_type: z.coerce.string(), - size: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codeScanningGetCodeqlDatabaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - language: z.coerce.string(), - }) - - router.get( - "codeScanningGetCodeqlDatabase", - "/repos/:owner/:repo/code-scanning/codeql/databases/:language", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningGetCodeqlDatabaseParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codeScanningGetCodeqlDatabase(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - language: z.coerce.string(), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), }), - content_type: z.coerce.string(), - size: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codeScanningUploadSarifParamSchema = z.object({ + const checksListAnnotationsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + check_run_id: z.coerce.number(), }) - const codeScanningUploadSarifBodySchema = z.object({ - commit_sha: z.coerce.string(), - ref: z.coerce.string(), - sarif: z.coerce.string(), - checkout_uri: z.coerce.string().optional(), - started_at: z.coerce.string().datetime({ offset: true }).optional(), - tool_name: z.coerce.string().optional(), - validate: z.coerce.boolean().optional(), + const checksListAnnotationsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "codeScanningUploadSarif", - "/repos/:owner/:repo/code-scanning/sarifs", + router.get( + "checksListAnnotations", + "/repos/:owner/:repo/check-runs/:checkRunId/annotations", async (ctx, next) => { const input = { - params: parseRequestInput( - codeScanningUploadSarifParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(codeScanningUploadSarifBodySchema, ctx.body), + params: parseRequestInput(checksListAnnotationsParamSchema, ctx.params), + query: parseRequestInput(checksListAnnotationsQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.codeScanningUploadSarif( + const { status, body } = await implementation.checksListAnnotations( input, ctx ) - if (status === 202) { - ctx.body = z - .object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + annotation_level: z.coerce.string(), + title: z.coerce.string(), + message: z.coerce.string(), + raw_details: z.coerce.string(), + blob_href: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codeScanningGetSarifParamSchema = z.object({ + const checksRerequestRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - sarif_id: z.coerce.string(), + check_run_id: z.coerce.number(), }) - router.get( - "codeScanningGetSarif", - "/repos/:owner/:repo/code-scanning/sarifs/:sarifId", + router.post( + "checksRerequestRun", + "/repos/:owner/:repo/check-runs/:checkRunId/rerequest", async (ctx, next) => { const input = { - params: parseRequestInput(codeScanningGetSarifParamSchema, ctx.params), + params: parseRequestInput(checksRerequestRunParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.codeScanningGetSarif( + const { status, body } = await implementation.checksRerequestRun( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - processing_status: z - .enum(["pending", "complete", "failed"]) - .optional(), - analyses_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCodeownersErrorsParamSchema = z.object({ + const checksCreateSuiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposCodeownersErrorsQuerySchema = z.object({ - ref: z.coerce.string().optional(), - }) + const checksCreateSuiteBodySchema = z.object({ head_sha: z.coerce.string() }) - router.get( - "reposCodeownersErrors", - "/repos/:owner/:repo/codeowners/errors", + router.post( + "checksCreateSuite", + "/repos/:owner/:repo/check-suites", async (ctx, next) => { const input = { - params: parseRequestInput(reposCodeownersErrorsParamSchema, ctx.params), - query: parseRequestInput(reposCodeownersErrorsQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(checksCreateSuiteParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(checksCreateSuiteBodySchema, ctx.body), } - const { status, body } = await implementation.reposCodeownersErrors( + const { status, body } = await implementation.checksCreateSuite( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - errors: z.array( - z.object({ - line: z.coerce.number(), - column: z.coerce.number(), - source: z.coerce.string().optional(), - kind: z.coerce.string(), - suggestion: z.coerce.string().optional(), - message: z.coerce.string(), - path: z.coerce.string(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesListInRepositoryForAuthenticatedUserParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesListInRepositoryForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "codespacesListInRepositoryForAuthenticatedUser", - "/repos/:owner/:repo/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesListInRepositoryForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListInRepositoryForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesListInRepositoryForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -56932,7 +59293,32 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - billable_owner: z.object({ + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -56955,1185 +59341,1428 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }), + ], + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce + created_at: z.coerce .string() .datetime({ offset: true }) .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesCreateWithRepoForAuthenticatedUserParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesCreateWithRepoForAuthenticatedUserBodySchema = z.object({ - ref: z.coerce.string().optional(), - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - multi_repo_permissions_opt_out: z.coerce.boolean().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - display_name: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksSetSuitesPreferencesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.post( - "codespacesCreateWithRepoForAuthenticatedUser", - "/repos/:owner/:repo/codespaces", + const checksSetSuitesPreferencesBodySchema = z.object({ + auto_trigger_checks: z + .array( + z.object({ app_id: z.coerce.number(), setting: z.coerce.boolean() }) + ) + .optional(), + }) + + router.patch( + "checksSetSuitesPreferences", + "/repos/:owner/:repo/check-suites/preferences", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesCreateWithRepoForAuthenticatedUserParamSchema, + checksSetSuitesPreferencesParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - codespacesCreateWithRepoForAuthenticatedUserBodySchema, - ctx.body - ), + body: parseRequestInput(checksSetSuitesPreferencesBodySchema, ctx.body), } - const { status, body } = - await implementation.codespacesCreateWithRepoForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.checksSetSuitesPreferences( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + preferences: z.object({ + auto_trigger_checks: z + .array( + z.object({ + app_id: z.coerce.number(), + setting: z.coerce.boolean(), + }) + ) + .optional(), + }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksGetSuiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + check_suite_id: z.coerce.number(), + }) + + router.get( + "checksGetSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksGetSuiteParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.checksGetSuite(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 202) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema = - z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + const checksListForSuiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + check_suite_id: z.coerce.number(), + }) - const codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema = - z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const checksListForSuiteQuerySchema = z.object({ + check_name: z.coerce.string().optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + filter: z.enum(["latest", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) router.get( - "codespacesListDevcontainersInRepositoryForAuthenticatedUser", - "/repos/:owner/:repo/codespaces/devcontainers", + "checksListForSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId/check-runs", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema, - ctx.query - ), + params: parseRequestInput(checksListForSuiteParamSchema, ctx.params), + query: parseRequestInput(checksListForSuiteQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.codespacesListDevcontainersInRepositoryForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.checksListForSuite( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - devcontainers: z.array( - z.object({ - path: z.coerce.string(), - name: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksRerequestSuiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + check_suite_id: z.coerce.number(), + }) + + router.post( + "checksRerequestSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId/rerequest", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksRerequestSuiteParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.checksRerequestSuite( + input, + ctx + ) + + ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const codespacesRepoMachinesForAuthenticatedUserParamSchema = z.object({ + const codeScanningListAlertsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const codespacesRepoMachinesForAuthenticatedUserQuerySchema = z.object({ - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), + const codeScanningListAlertsForRepoQuerySchema = z.object({ + tool_name: z.coerce.string().optional(), + tool_guid: z.coerce.string().optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + direction: z.enum(["asc", "desc"]).optional(), + sort: z.enum(["created", "updated"]).optional(), + state: z.enum(["open", "closed", "dismissed", "fixed"]).optional(), + severity: z + .enum(["critical", "high", "medium", "low", "warning", "note", "error"]) + .optional(), }) router.get( - "codespacesRepoMachinesForAuthenticatedUser", - "/repos/:owner/:repo/codespaces/machines", + "codeScanningListAlertsForRepo", + "/repos/:owner/:repo/code-scanning/alerts", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesRepoMachinesForAuthenticatedUserParamSchema, + codeScanningListAlertsForRepoParamSchema, ctx.params ), query: parseRequestInput( - codespacesRepoMachinesForAuthenticatedUserQuerySchema, + codeScanningListAlertsForRepoQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.codespacesRepoMachinesForAuthenticatedUser( - input, - ctx - ) + await implementation.codeScanningListAlertsForRepo(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - machines: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + description: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), }) ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesPreFlightWithRepoForAuthenticatedUserParamSchema = z.object({ + const codeScanningGetAlertParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema = z.object({ - ref: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), + alert_number: z.coerce.number(), }) router.get( - "codespacesPreFlightWithRepoForAuthenticatedUser", - "/repos/:owner/:repo/codespaces/new", + "codeScanningGetAlert", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesPreFlightWithRepoForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema, - ctx.query - ), + params: parseRequestInput(codeScanningGetAlertParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesPreFlightWithRepoForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.codeScanningGetAlert( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - billable_owner: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -58155,398 +60784,726 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - defaults: z - .object({ - location: z.coerce.string(), - devcontainer_path: z.coerce.string(), - }) - .optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesListRepoSecretsParamSchema = z.object({ + const codeScanningUpdateAlertParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + alert_number: z.coerce.number(), }) - const codespacesListRepoSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codeScanningUpdateAlertBodySchema = z.object({ + state: z.enum(["open", "dismissed"]), + dismissed_reason: z + .enum(["null", "false positive", "won't fix", "used in tests"]) + .optional(), + dismissed_comment: z.coerce.string().optional(), }) - router.get( - "codespacesListRepoSecrets", - "/repos/:owner/:repo/codespaces/secrets", + router.patch( + "codeScanningUpdateAlert", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesListRepoSecretsParamSchema, + codeScanningUpdateAlertParamSchema, ctx.params ), - query: parseRequestInput( - codespacesListRepoSecretsQuerySchema, - ctx.query - ), - body: undefined, + query: undefined, + body: parseRequestInput(codeScanningUpdateAlertBodySchema, ctx.body), } - const { status, body } = await implementation.codespacesListRepoSecrets( + const { status, body } = await implementation.codeScanningUpdateAlert( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesGetRepoPublicKeyParamSchema = z.object({ + const codeScanningListAlertInstancesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + alert_number: z.coerce.number(), }) - router.get( - "codespacesGetRepoPublicKey", - "/repos/:owner/:repo/codespaces/secrets/public-key", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesGetRepoPublicKeyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codespacesGetRepoPublicKey( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesGetRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), + const codeScanningListAlertInstancesQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), }) router.get( - "codespacesGetRepoSecret", - "/repos/:owner/:repo/codespaces/secrets/:secretName", + "codeScanningListAlertInstances", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber/instances", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesGetRepoSecretParamSchema, + codeScanningListAlertInstancesParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + codeScanningListAlertInstancesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.codespacesGetRepoSecret( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } + const { status, body } = + await implementation.codeScanningListAlertInstances(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesCreateOrUpdateRepoSecretParamSchema = z.object({ + const codeScanningListRecentAnalysesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - secret_name: z.coerce.string(), }) - const codespacesCreateOrUpdateRepoSecretBodySchema = z.object({ - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string().optional(), + const codeScanningListRecentAnalysesQuerySchema = z.object({ + tool_name: z.coerce.string().optional(), + tool_guid: z.coerce.string().optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + sarif_id: z.coerce.string().optional(), + direction: z.enum(["asc", "desc"]).optional(), + sort: z.enum(["created"]).optional(), }) - router.put( - "codespacesCreateOrUpdateRepoSecret", - "/repos/:owner/:repo/codespaces/secrets/:secretName", + router.get( + "codeScanningListRecentAnalyses", + "/repos/:owner/:repo/code-scanning/analyses", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesCreateOrUpdateRepoSecretParamSchema, + codeScanningListRecentAnalysesParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - codespacesCreateOrUpdateRepoSecretBodySchema, - ctx.body + query: parseRequestInput( + codeScanningListRecentAnalysesQuerySchema, + ctx.query ), + body: undefined, } const { status, body } = - await implementation.codespacesCreateOrUpdateRepoSecret(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } + await implementation.codeScanningListRecentAnalyses(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref: z.coerce.string(), + commit_sha: z.coerce.string(), + analysis_key: z.coerce.string(), + environment: z.coerce.string(), + category: z.coerce.string().optional(), + error: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + results_count: z.coerce.number(), + rules_count: z.coerce.number(), + id: z.coerce.number(), + url: z.coerce.string(), + sarif_id: z.coerce.string(), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + deletable: z.coerce.boolean(), + warning: z.coerce.string(), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesDeleteRepoSecretParamSchema = z.object({ + const codeScanningGetAnalysisParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - secret_name: z.coerce.string(), + analysis_id: z.coerce.number(), }) - router.delete( - "codespacesDeleteRepoSecret", - "/repos/:owner/:repo/codespaces/secrets/:secretName", + router.get( + "codeScanningGetAnalysis", + "/repos/:owner/:repo/code-scanning/analyses/:analysisId", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesDeleteRepoSecretParamSchema, + codeScanningGetAnalysisParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.codespacesDeleteRepoSecret( + const { status, body } = await implementation.codeScanningGetAnalysis( input, ctx ) + ctx.body = responseValidationFactory( + [ + ["200", z.object({})], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListCollaboratorsParamSchema = z.object({ + const codeScanningDeleteAnalysisParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + analysis_id: z.coerce.number(), }) - const reposListCollaboratorsQuerySchema = z.object({ - affiliation: z.enum(["outside", "direct", "all"]).optional(), - permission: z - .enum(["pull", "triage", "push", "maintain", "admin"]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codeScanningDeleteAnalysisQuerySchema = z.object({ + confirm_delete: z.coerce.string().optional(), }) - router.get( - "reposListCollaborators", - "/repos/:owner/:repo/collaborators", + router.delete( + "codeScanningDeleteAnalysis", + "/repos/:owner/:repo/code-scanning/analyses/:analysisId", async (ctx, next) => { const input = { params: parseRequestInput( - reposListCollaboratorsParamSchema, + codeScanningDeleteAnalysisParamSchema, ctx.params ), - query: parseRequestInput(reposListCollaboratorsQuerySchema, ctx.query), + query: parseRequestInput( + codeScanningDeleteAnalysisQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposListCollaborators( + const { status, body } = await implementation.codeScanningDeleteAnalysis( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - admin: z.coerce.boolean(), - }) - .optional(), - role_name: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + next_analysis_url: z.coerce.string(), + confirm_delete_url: z.coerce.string(), + }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCheckCollaboratorParamSchema = z.object({ + const codeScanningListCodeqlDatabasesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - username: z.coerce.string(), }) router.get( - "reposCheckCollaborator", - "/repos/:owner/:repo/collaborators/:username", + "codeScanningListCodeqlDatabases", + "/repos/:owner/:repo/code-scanning/codeql/databases", async (ctx, next) => { const input = { params: parseRequestInput( - reposCheckCollaboratorParamSchema, + codeScanningListCodeqlDatabasesParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposCheckCollaborator( - input, - ctx - ) + const { status, body } = + await implementation.codeScanningListCodeqlDatabases(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + language: z.coerce.string(), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposAddCollaboratorParamSchema = z.object({ + const codeScanningGetCodeqlDatabaseParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - username: z.coerce.string(), + language: z.coerce.string(), }) - const reposAddCollaboratorBodySchema = z - .object({ permission: z.coerce.string().optional() }) - .optional() - - router.put( - "reposAddCollaborator", - "/repos/:owner/:repo/collaborators/:username", + router.get( + "codeScanningGetCodeqlDatabase", + "/repos/:owner/:repo/code-scanning/codeql/databases/:language", async (ctx, next) => { const input = { - params: parseRequestInput(reposAddCollaboratorParamSchema, ctx.params), + params: parseRequestInput( + codeScanningGetCodeqlDatabaseParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(reposAddCollaboratorBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reposAddCollaborator( - input, - ctx - ) + const { status, body } = + await implementation.codeScanningGetCodeqlDatabase(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + language: z.coerce.string(), + uploader: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -58569,742 +61526,663 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + ["302", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposRemoveCollaboratorParamSchema = z.object({ + const codeScanningUploadSarifParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - username: z.coerce.string(), }) - router.delete( - "reposRemoveCollaborator", - "/repos/:owner/:repo/collaborators/:username", + const codeScanningUploadSarifBodySchema = z.object({ + commit_sha: z.coerce.string(), + ref: z.coerce.string(), + sarif: z.coerce.string(), + checkout_uri: z.coerce.string().optional(), + started_at: z.coerce.string().datetime({ offset: true }).optional(), + tool_name: z.coerce.string().optional(), + validate: z.coerce.boolean().optional(), + }) + + router.post( + "codeScanningUploadSarif", + "/repos/:owner/:repo/code-scanning/sarifs", async (ctx, next) => { const input = { params: parseRequestInput( - reposRemoveCollaboratorParamSchema, + codeScanningUploadSarifParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(codeScanningUploadSarifBodySchema, ctx.body), } - const { status, body } = await implementation.reposRemoveCollaborator( + const { status, body } = await implementation.codeScanningUploadSarif( input, ctx ) + ctx.body = responseValidationFactory( + [ + [ + "202", + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }), + ], + ["400", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["413", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetCollaboratorPermissionLevelParamSchema = z.object({ + const codeScanningGetSarifParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - username: z.coerce.string(), + sarif_id: z.coerce.string(), }) router.get( - "reposGetCollaboratorPermissionLevel", - "/repos/:owner/:repo/collaborators/:username/permission", + "codeScanningGetSarif", + "/repos/:owner/:repo/code-scanning/sarifs/:sarifId", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetCollaboratorPermissionLevelParamSchema, - ctx.params - ), + params: parseRequestInput(codeScanningGetSarifParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.reposGetCollaboratorPermissionLevel(input, ctx) + const { status, body } = await implementation.codeScanningGetSarif( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - permission: z.coerce.string(), - role_name: z.coerce.string(), - user: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - admin: z.coerce.boolean(), - }) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + processing_status: z + .enum(["pending", "complete", "failed"]) .optional(), - role_name: z.coerce.string(), + analyses_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListCommitCommentsForRepoParamSchema = z.object({ + const reposCodeownersErrorsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposListCommitCommentsForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommitCommentsForRepo", - "/repos/:owner/:repo/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommitCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommitCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListCommitCommentsForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), + const reposCodeownersErrorsQuerySchema = z.object({ + ref: z.coerce.string().optional(), }) router.get( - "reposGetCommitComment", - "/repos/:owner/:repo/comments/:commentId", + "reposCodeownersErrors", + "/repos/:owner/:repo/codeowners/errors", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetCommitCommentParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(reposCodeownersErrorsParamSchema, ctx.params), + query: parseRequestInput(reposCodeownersErrorsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposGetCommitComment( + const { status, body } = await implementation.reposCodeownersErrors( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + errors: z.array( + z.object({ + line: z.coerce.number(), + column: z.coerce.number(), + source: z.coerce.string().optional(), + kind: z.coerce.string(), + suggestion: z.coerce.string().optional(), + message: z.coerce.string(), + path: z.coerce.string(), + }) + ), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposUpdateCommitCommentParamSchema = z.object({ + const codespacesListInRepositoryForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - const reposUpdateCommitCommentBodySchema = z.object({ - body: z.coerce.string(), + const codespacesListInRepositoryForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.patch( - "reposUpdateCommitComment", - "/repos/:owner/:repo/comments/:commentId", + router.get( + "codespacesListInRepositoryForAuthenticatedUser", + "/repos/:owner/:repo/codespaces", async (ctx, next) => { const input = { params: parseRequestInput( - reposUpdateCommitCommentParamSchema, + codespacesListInRepositoryForAuthenticatedUserParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput(reposUpdateCommitCommentBodySchema, ctx.body), + query: parseRequestInput( + codespacesListInRepositoryForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.reposUpdateCommitComment( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteCommitComment", - "/repos/:owner/:repo/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteCommitComment( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.codespacesListInRepositoryForAuthenticatedUser( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce + .string() + .optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsListForCommitCommentParamSchema = z.object({ + const codespacesCreateWithRepoForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - const reactionsListForCommitCommentQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codespacesCreateWithRepoForAuthenticatedUserBodySchema = z.object({ + ref: z.coerce.string().optional(), + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + multi_repo_permissions_opt_out: z.coerce.boolean().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + display_name: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), }) - router.get( - "reactionsListForCommitComment", - "/repos/:owner/:repo/comments/:commentId/reactions", + router.post( + "codespacesCreateWithRepoForAuthenticatedUser", + "/repos/:owner/:repo/codespaces", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsListForCommitCommentParamSchema, + codespacesCreateWithRepoForAuthenticatedUserParamSchema, ctx.params ), - query: parseRequestInput( - reactionsListForCommitCommentQuerySchema, - ctx.query + query: undefined, + body: parseRequestInput( + codespacesCreateWithRepoForAuthenticatedUserBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.reactionsListForCommitComment(input, ctx) + await implementation.codespacesCreateWithRepoForAuthenticatedUser( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -59327,278 +62205,7 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsCreateForCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsCreateForCommitCommentBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) - - router.post( - "reactionsCreateForCommitComment", - "/repos/:owner/:repo/comments/:commentId/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reactionsCreateForCommitCommentBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reactionsCreateForCommitComment(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsDeleteForCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - reaction_id: z.coerce.number(), - }) - - router.delete( - "reactionsDeleteForCommitComment", - "/repos/:owner/:repo/comments/:commentId/reactions/:reactionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsDeleteForCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reactionsDeleteForCommitComment(input, ctx) - - ctx.status = status - return next() - } - ) - - const reposListCommitsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListCommitsQuerySchema = z.object({ - sha: z.coerce.string().optional(), - path: z.coerce.string().optional(), - author: z.coerce.string().optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - until: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommits", - "/repos/:owner/:repo/commits", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListCommitsParamSchema, ctx.params), - query: parseRequestInput(reposListCommitsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListCommits(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ + billable_owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -59621,7 +62228,249 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - committer: z.object({ + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "202", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -59644,204 +62493,7 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposListBranchesForHeadCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - router.get( - "reposListBranchesForHeadCommit", - "/repos/:owner/:repo/commits/:commitSha/branches-where-head", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListBranchesForHeadCommitParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposListBranchesForHeadCommit(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - protected: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposListCommentsForCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - const reposListCommentsForCommitQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommentsForCommit", - "/repos/:owner/:repo/commits/:commitSha/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommentsForCommitParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommentsForCommitQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.reposListCommentsForCommit( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ + billable_owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -59864,274 +62516,534 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - const reposCreateCommitCommentBodySchema = z.object({ - body: z.coerce.string(), - path: z.coerce.string().optional(), - position: z.coerce.number().optional(), - line: z.coerce.number().optional(), - }) - - router.post( - "reposCreateCommitComment", - "/repos/:owner/:repo/commits/:commitSha/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateCommitCommentBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateCommitComment( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), }) - ) - .optional(), - }) - .parse(body) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema = + z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + + const codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema = + z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "codespacesListDevcontainersInRepositoryForAuthenticatedUser", + "/repos/:owner/:repo/codespaces/devcontainers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.codespacesListDevcontainersInRepositoryForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + devcontainers: z.array( + z.object({ + path: z.coerce.string(), + name: z.coerce.string().optional(), + }) + ), + }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListPullRequestsAssociatedWithCommitParamSchema = z.object({ + const codespacesRepoMachinesForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - commit_sha: z.coerce.string(), }) - const reposListPullRequestsAssociatedWithCommitQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codespacesRepoMachinesForAuthenticatedUserQuerySchema = z.object({ + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), }) router.get( - "reposListPullRequestsAssociatedWithCommit", - "/repos/:owner/:repo/commits/:commitSha/pulls", + "codespacesRepoMachinesForAuthenticatedUser", + "/repos/:owner/:repo/codespaces/machines", async (ctx, next) => { const input = { params: parseRequestInput( - reposListPullRequestsAssociatedWithCommitParamSchema, + codespacesRepoMachinesForAuthenticatedUserParamSchema, ctx.params ), query: parseRequestInput( - reposListPullRequestsAssociatedWithCommitQuerySchema, + codespacesRepoMachinesForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.reposListPullRequestsAssociatedWithCommit( + await implementation.codespacesRepoMachinesForAuthenticatedUser( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( + total_count: z.coerce.number(), + machines: z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), }) ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesPreFlightWithRepoForAuthenticatedUserParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema = z.object({ + ref: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + }) + + router.get( + "codespacesPreFlightWithRepoForAuthenticatedUser", + "/repos/:owner/:repo/codespaces/new", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesPreFlightWithRepoForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesPreFlightWithRepoForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + billable_owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -60153,813 +63065,842 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) + }) .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) + defaults: z + .object({ + location: z.coerce.string(), + devcontainer_path: z.coerce.string(), + }) .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesListRepoSecretsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const codespacesListRepoSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "codespacesListRepoSecrets", + "/repos/:owner/:repo/codespaces/secrets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesListRepoSecretsParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesListRepoSecretsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.codespacesListRepoSecrets( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesGetRepoPublicKeyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "codespacesGetRepoPublicKey", + "/repos/:owner/:repo/codespaces/secrets/public-key", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetRepoPublicKeyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.codespacesGetRepoPublicKey( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesGetRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.get( + "codespacesGetRepoSecret", + "/repos/:owner/:repo/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.codespacesGetRepoSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateOrUpdateRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const codespacesCreateOrUpdateRepoSecretBodySchema = z.object({ + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string().optional(), + }) + + router.put( + "codespacesCreateOrUpdateRepoSecret", + "/repos/:owner/:repo/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCreateOrUpdateRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesCreateOrUpdateRepoSecretBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateOrUpdateRepoSecret(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesDeleteRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.delete( + "codespacesDeleteRepoSecret", + "/repos/:owner/:repo/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesDeleteRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.codespacesDeleteRepoSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListCollaboratorsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListCollaboratorsQuerySchema = z.object({ + affiliation: z.enum(["outside", "direct", "all"]).optional(), + permission: z + .enum(["pull", "triage", "push", "maintain", "admin"]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListCollaborators", + "/repos/:owner/:repo/collaborators", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCollaboratorsParamSchema, + ctx.params + ), + query: parseRequestInput(reposListCollaboratorsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListCollaborators( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ + .optional(), + role_name: z.coerce.string(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCheckCollaboratorParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + username: z.coerce.string(), + }) + + router.get( + "reposCheckCollaborator", + "/repos/:owner/:repo/collaborators/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCheckCollaboratorParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposCheckCollaborator( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposAddCollaboratorParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + username: z.coerce.string(), + }) + + const reposAddCollaboratorBodySchema = z + .object({ permission: z.coerce.string().optional() }) + .optional() + + router.put( + "reposAddCollaborator", + "/repos/:owner/:repo/collaborators/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposAddCollaboratorParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposAddCollaboratorBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposAddCollaborator( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), received_events_url: z.coerce.string(), type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ key: z.coerce.string(), name: z.coerce.string(), url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", ]), - auto_merge: z.object({ - enabled_by: z.object({ + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }), + ], + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveCollaboratorParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + username: z.coerce.string(), + }) + + router.delete( + "reposRemoveCollaborator", + "/repos/:owner/:repo/collaborators/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveCollaboratorParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposRemoveCollaborator( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposGetCollaboratorPermissionLevelParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + username: z.coerce.string(), + }) + + router.get( + "reposGetCollaboratorPermissionLevel", + "/repos/:owner/:repo/collaborators/:username/permission", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCollaboratorPermissionLevelParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetCollaboratorPermissionLevel(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + permission: z.coerce.string(), + role_name: z.coerce.string(), + user: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + }) + .optional(), + role_name: z.coerce.string(), + }), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListCommitCommentsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListCommitCommentsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListCommitCommentsForRepo", + "/repos/:owner/:repo/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCommitCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommitCommentsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListCommitCommentsForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -60982,815 +63923,450 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } - + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetCommitParamSchema = z.object({ + const reposGetCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposGetCommitQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), + comment_id: z.coerce.number(), }) router.get( - "reposGetCommit", - "/repos/:owner/:repo/commits/:ref", + "reposGetCommitComment", + "/repos/:owner/:repo/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetCommitParamSchema, ctx.params), - query: parseRequestInput(reposGetCommitQuerySchema, ctx.query), + params: parseRequestInput(reposGetCommitCommentParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetCommit(input, ctx) + const { status, body } = await implementation.reposGetCommitComment( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + html_url: z.coerce.string(), url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) .optional(), }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateCommitCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const reposUpdateCommitCommentBodySchema = z.object({ + body: z.coerce.string(), + }) + + router.patch( + "reposUpdateCommitComment", + "/repos/:owner/:repo/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdateCommitCommentParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposUpdateCommitCommentBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdateCommitComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteCommitCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteCommitComment", + "/repos/:owner/:repo/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDeleteCommitCommentParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposDeleteCommitComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksListForRefParamSchema = z.object({ + const reactionsListForCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), + comment_id: z.coerce.number(), }) - const checksListForRefQuerySchema = z.object({ - check_name: z.coerce.string().optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - filter: z.enum(["latest", "all"]).optional(), + const reactionsListForCommitCommentQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - app_id: z.coerce.number().optional(), }) router.get( - "checksListForRef", - "/repos/:owner/:repo/commits/:ref/check-runs", + "reactionsListForCommitComment", + "/repos/:owner/:repo/comments/:commentId/reactions", async (ctx, next) => { const input = { - params: parseRequestInput(checksListForRefParamSchema, ctx.params), - query: parseRequestInput(checksListForRefQuerySchema, ctx.query), + params: parseRequestInput( + reactionsListForCommitCommentParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForCommitCommentQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.checksListForRef(input, ctx) + const { status, body } = + await implementation.reactionsListForCommitComment(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - check_runs: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - head_sha: z.coerce.string(), node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }) ), - }) - .parse(body) - } - + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const checksListSuitesForRefParamSchema = z.object({ + const reactionsCreateForCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), + comment_id: z.coerce.number(), }) - const checksListSuitesForRefQuerySchema = z.object({ - app_id: z.coerce.number().optional(), - check_name: z.coerce.string().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reactionsCreateForCommitCommentBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) - router.get( - "checksListSuitesForRef", - "/repos/:owner/:repo/commits/:ref/check-suites", + router.post( + "reactionsCreateForCommitComment", + "/repos/:owner/:repo/comments/:commentId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - checksListSuitesForRefParamSchema, + reactionsCreateForCommitCommentParamSchema, ctx.params ), - query: parseRequestInput(checksListSuitesForRefQuerySchema, ctx.query), - body: undefined, + query: undefined, + body: parseRequestInput( + reactionsCreateForCommitCommentBodySchema, + ctx.body + ), } - const { status, body } = await implementation.checksListSuitesForRef( - input, - ctx - ) + const { status, body } = + await implementation.reactionsCreateForCommitComment(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - check_suites: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetCombinedStatusForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposGetCombinedStatusForRefQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposGetCombinedStatusForRef", - "/repos/:owner/:repo/commits/:ref/status", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCombinedStatusForRefParamSchema, - ctx.params - ), - query: parseRequestInput( - reposGetCombinedStatusForRefQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposGetCombinedStatusForRef(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - state: z.coerce.string(), - statuses: z.array( - z.object({ - description: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.coerce.string(), - context: z.coerce.string(), - target_url: z.coerce.string(), - required: z.coerce.boolean().optional(), - avatar_url: z.coerce.string(), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - sha: z.coerce.string(), - total_count: z.coerce.number(), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -61813,205 +64389,25 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }), - commit_url: z.coerce.string(), - url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposListCommitStatusesForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposListCommitStatusesForRefQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommitStatusesForRef", - "/repos/:owner/:repo/commits/:ref/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommitStatusesForRefParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommitStatusesForRefQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListCommitStatusesForRef(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + ], + [ + "201", z.object({ - url: z.coerce.string(), - avatar_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - state: z.coerce.string(), - description: z.coerce.string(), - target_url: z.coerce.string(), - context: z.coerce.string(), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - creator: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -62034,37 +64430,64 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetCommunityProfileMetricsParamSchema = z.object({ + const reactionsDeleteForCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), + reaction_id: z.coerce.number(), }) - router.get( - "reposGetCommunityProfileMetrics", - "/repos/:owner/:repo/community/profile", + router.delete( + "reactionsDeleteForCommitComment", + "/repos/:owner/:repo/comments/:commentId/reactions/:reactionId", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetCommunityProfileMetricsParamSchema, + reactionsDeleteForCommitCommentParamSchema, ctx.params ), query: undefined, @@ -62072,338 +64495,49 @@ export function bootstrap( } const { status, body } = - await implementation.reposGetCommunityProfileMetrics(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - health_percentage: z.coerce.number(), - description: z.coerce.string(), - documentation: z.coerce.string(), - files: z.object({ - code_of_conduct: z.object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }), - code_of_conduct_file: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - contributing: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - readme: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - issue_template: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - pull_request_template: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - content_reports_enabled: z.coerce.boolean().optional(), - }) - .parse(body) - } + await implementation.reactionsDeleteForCommitComment(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposCompareCommitsParamSchema = z.object({ + const reposListCommitsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - basehead: z.coerce.string(), }) - const reposCompareCommitsQuerySchema = z.object({ - page: z.coerce.number().optional(), + const reposListCommitsQuerySchema = z.object({ + sha: z.coerce.string().optional(), + path: z.coerce.string().optional(), + author: z.coerce.string().optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + until: z.coerce.string().datetime({ offset: true }).optional(), per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposCompareCommits", - "/repos/:owner/:repo/compare/:basehead", + "reposListCommits", + "/repos/:owner/:repo/commits", async (ctx, next) => { const input = { - params: parseRequestInput(reposCompareCommitsParamSchema, ctx.params), - query: parseRequestInput(reposCompareCommitsQuerySchema, ctx.query), + params: parseRequestInput(reposListCommitsParamSchema, ctx.params), + query: parseRequestInput(reposListCommitsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposCompareCommits( - input, - ctx - ) + const { status, body } = await implementation.reposListCommits(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - permalink_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - base_commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - merge_base_commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - status: z.enum(["diverged", "ahead", "behind", "identical"]), - ahead_by: z.coerce.number(), - behind_by: z.coerce.number(), - total_commits: z.coerce.number(), - commits: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ url: z.coerce.string(), sha: z.coerce.string(), @@ -62524,1731 +64658,501 @@ export function bootstrap( .optional(), }) ), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetContentParamSchema = z.object({ + const reposListBranchesForHeadCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - path: z.coerce.string(), - }) - - const reposGetContentQuerySchema = z.object({ - ref: z.coerce.string().optional(), + commit_sha: z.coerce.string(), }) router.get( - "reposGetContent", - "/repos/:owner/:repo/contents/:path", + "reposListBranchesForHeadCommit", + "/repos/:owner/:repo/commits/:commitSha/branches-where-head", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetContentParamSchema, ctx.params), - query: parseRequestInput(reposGetContentQuerySchema, ctx.query), + params: parseRequestInput( + reposListBranchesForHeadCommitParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetContent(input, ctx) + const { status, body } = + await implementation.reposListBranchesForHeadCommit(input, ctx) - if (status === 200) { - ctx.body = z - .union([ + ctx.body = responseValidationFactory( + [ + [ + "200", z.array( z.object({ - type: z.enum(["dir", "file", "submodule", "symlink"]), - size: z.coerce.number(), name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string().optional(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), }), + protected: z.coerce.boolean(), }) ), + ], + [ + "422", z.object({ - type: z.enum(["file"]), - encoding: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - target: z.coerce.string().optional(), - submodule_git_url: z.coerce.string().optional(), - }), - z.object({ - type: z.enum(["symlink"]), - target: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - }), - z.object({ - type: z.enum(["submodule"]), - submodule_git_url: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - ]) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateOrUpdateFileContentsParamSchema = z.object({ + const reposListCommentsForCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - path: z.coerce.string(), + commit_sha: z.coerce.string(), }) - const reposCreateOrUpdateFileContentsBodySchema = z.object({ - message: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - committer: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().optional(), - }) - .optional(), - author: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().optional(), - }) - .optional(), + const reposListCommentsForCommitQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.put( - "reposCreateOrUpdateFileContents", - "/repos/:owner/:repo/contents/:path", + router.get( + "reposListCommentsForCommit", + "/repos/:owner/:repo/commits/:commitSha/comments", async (ctx, next) => { const input = { params: parseRequestInput( - reposCreateOrUpdateFileContentsParamSchema, + reposListCommentsForCommitParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - reposCreateOrUpdateFileContentsBodySchema, - ctx.body + query: parseRequestInput( + reposListCommentsForCommitQuerySchema, + ctx.query ), + body: undefined, } - const { status, body } = - await implementation.reposCreateOrUpdateFileContents(input, ctx) + const { status, body } = await implementation.reposListCommentsForCommit( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - content: z.object({ - name: z.coerce.string().optional(), - path: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - download_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - _links: z - .object({ - self: z.coerce.string().optional(), - git: z.coerce.string().optional(), - html: z.coerce.string().optional(), - }) - .optional(), - }), - commit: z.object({ - sha: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - author: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - committer: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - tree: z - .object({ - url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - .optional(), - parents: z - .array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - ) - .optional(), - verification: z - .object({ - verified: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - signature: z.coerce.string().optional(), - payload: z.coerce.string().optional(), - }) - .optional(), - }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - content: z.object({ - name: z.coerce.string().optional(), - path: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - download_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - _links: z - .object({ - self: z.coerce.string().optional(), - git: z.coerce.string().optional(), - html: z.coerce.string().optional(), - }) - .optional(), - }), - commit: z.object({ - sha: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - author: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - committer: z - .object({ - date: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - tree: z - .object({ - url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - .optional(), - parents: z - .array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - verification: z - .object({ - verified: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - signature: z.coerce.string().optional(), - payload: z.coerce.string().optional(), - }) - .optional(), - }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeleteFileParamSchema = z.object({ + const reposCreateCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - path: z.coerce.string(), + commit_sha: z.coerce.string(), }) - const reposDeleteFileBodySchema = z.object({ - message: z.coerce.string(), - sha: z.coerce.string(), - branch: z.coerce.string().optional(), - committer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - author: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), + const reposCreateCommitCommentBodySchema = z.object({ + body: z.coerce.string(), + path: z.coerce.string().optional(), + position: z.coerce.number().optional(), + line: z.coerce.number().optional(), }) - router.delete( - "reposDeleteFile", - "/repos/:owner/:repo/contents/:path", + router.post( + "reposCreateCommitComment", + "/repos/:owner/:repo/commits/:commitSha/comments", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeleteFileParamSchema, ctx.params), + params: parseRequestInput( + reposCreateCommitCommentParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(reposDeleteFileBodySchema, ctx.body), + body: parseRequestInput(reposCreateCommitCommentBodySchema, ctx.body), } - const { status, body } = await implementation.reposDeleteFile(input, ctx) + const { status, body } = await implementation.reposCreateCommitComment( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - content: z.object({ - name: z.coerce.string().optional(), - path: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - download_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - _links: z + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z .object({ - self: z.coerce.string().optional(), - git: z.coerce.string().optional(), - html: z.coerce.string().optional(), + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) .optional(), }), - commit: z.object({ - sha: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - author: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - committer: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), - tree: z - .object({ - url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - .optional(), - parents: z + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z .array( z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) ) .optional(), - verification: z - .object({ - verified: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - signature: z.coerce.string().optional(), - payload: z.coerce.string().optional(), - }) - .optional(), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListContributorsParamSchema = z.object({ + const reposListPullRequestsAssociatedWithCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + commit_sha: z.coerce.string(), }) - const reposListContributorsQuerySchema = z.object({ - anon: z.coerce.string().optional(), + const reposListPullRequestsAssociatedWithCommitQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "reposListContributors", - "/repos/:owner/:repo/contributors", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListContributorsParamSchema, ctx.params), - query: parseRequestInput(reposListContributorsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListContributors( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string(), - site_admin: z.coerce.boolean().optional(), - contributions: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotListAlertsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const dependabotListAlertsForRepoQuerySchema = z.object({ - state: z.coerce.string().optional(), - severity: z.coerce.string().optional(), - ecosystem: z.coerce.string().optional(), - package: z.coerce.string().optional(), - manifest: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - first: z.coerce.number().optional(), - last: z.coerce.number().optional(), - }) - - router.get( - "dependabotListAlertsForRepo", - "/repos/:owner/:repo/dependabot/alerts", + "reposListPullRequestsAssociatedWithCommit", + "/repos/:owner/:repo/commits/:commitSha/pulls", async (ctx, next) => { const input = { params: parseRequestInput( - dependabotListAlertsForRepoParamSchema, + reposListPullRequestsAssociatedWithCommitParamSchema, ctx.params ), query: parseRequestInput( - dependabotListAlertsForRepoQuerySchema, + reposListPullRequestsAssociatedWithCommitQuerySchema, ctx.query ), body: undefined, } - const { status, body } = await implementation.dependabotListAlertsForRepo( - input, - ctx - ) + const { status, body } = + await implementation.reposListPullRequestsAssociatedWithCommit( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - cwes: z.array( + body: z.coerce.string(), + labels: z.array( z.object({ - cwe_id: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), }) ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotGetAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - router.get( - "dependabotGetAlert", - "/repos/:owner/:repo/dependabot/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(dependabotGetAlertParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotGetAlert( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ cwe_id: z.coerce.string(), name: z.coerce.string() }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotUpdateAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const dependabotUpdateAlertBodySchema = z.object({ - state: z.enum(["dismissed", "open"]), - dismissed_reason: z - .enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]) - .optional(), - dismissed_comment: z.coerce.string().optional(), - }) - - router.patch( - "dependabotUpdateAlert", - "/repos/:owner/:repo/dependabot/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(dependabotUpdateAlertParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(dependabotUpdateAlertBodySchema, ctx.body), - } - - const { status, body } = await implementation.dependabotUpdateAlert( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ cwe_id: z.coerce.string(), name: z.coerce.string() }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotListRepoSecretsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const dependabotListRepoSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "dependabotListRepoSecrets", - "/repos/:owner/:repo/dependabot/secrets", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotListRepoSecretsParamSchema, - ctx.params - ), - query: parseRequestInput( - dependabotListRepoSecretsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.dependabotListRepoSecrets( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotGetRepoPublicKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "dependabotGetRepoPublicKey", - "/repos/:owner/:repo/dependabot/secrets/public-key", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotGetRepoPublicKeyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotGetRepoPublicKey( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ key_id: z.coerce.string(), key: z.coerce.string() }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotGetRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.get( - "dependabotGetRepoSecret", - "/repos/:owner/:repo/dependabot/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotGetRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotGetRepoSecret( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotCreateOrUpdateRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const dependabotCreateOrUpdateRepoSecretBodySchema = z.object({ - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string().optional(), - }) - - router.put( - "dependabotCreateOrUpdateRepoSecret", - "/repos/:owner/:repo/dependabot/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotCreateOrUpdateRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - dependabotCreateOrUpdateRepoSecretBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.dependabotCreateOrUpdateRepoSecret(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependabotDeleteRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.delete( - "dependabotDeleteRepoSecret", - "/repos/:owner/:repo/dependabot/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotDeleteRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotDeleteRepoSecret( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const dependencyGraphDiffRangeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - basehead: z.coerce.string(), - }) - - const dependencyGraphDiffRangeQuerySchema = z.object({ - name: z.coerce.string().optional(), - }) - - router.get( - "dependencyGraphDiffRange", - "/repos/:owner/:repo/dependency-graph/compare/:basehead", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependencyGraphDiffRangeParamSchema, - ctx.params - ), - query: parseRequestInput( - dependencyGraphDiffRangeQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.dependencyGraphDiffRange( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - change_type: z.enum(["added", "removed"]), - manifest: z.coerce.string(), - ecosystem: z.coerce.string(), - name: z.coerce.string(), - version: z.coerce.string(), - package_url: z.coerce.string(), - license: z.coerce.string(), - source_repository_url: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - severity: z.coerce.string(), - advisory_ghsa_id: z.coerce.string(), - advisory_summary: z.coerce.string(), - advisory_url: z.coerce.string(), - }) - ), - scope: z.enum(["unknown", "runtime", "development"]), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const dependencyGraphCreateRepositorySnapshotParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const dependencyGraphCreateRepositorySnapshotBodySchema = z.object({ - version: z.coerce.number(), - job: z.object({ - id: z.coerce.string(), - correlator: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - sha: z.coerce.string(), - ref: z.coerce.string(), - detector: z.object({ - name: z.coerce.string(), - version: z.coerce.string(), - url: z.coerce.string(), - }), - metadata: z.object({}).optional(), - manifests: z.object({}).optional(), - scanned: z.coerce.string().datetime({ offset: true }), - }) - - router.post( - "dependencyGraphCreateRepositorySnapshot", - "/repos/:owner/:repo/dependency-graph/snapshots", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependencyGraphCreateRepositorySnapshotParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - dependencyGraphCreateRepositorySnapshotBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.dependencyGraphCreateRepositorySnapshot(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - created_at: z.coerce.string(), - result: z.coerce.string(), - message: z.coerce.string(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposListDeploymentsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListDeploymentsQuerySchema = z.object({ - sha: z.coerce.string().optional(), - ref: z.coerce.string().optional(), - task: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListDeployments", - "/repos/:owner/:repo/deployments", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListDeploymentsParamSchema, ctx.params), - query: parseRequestInput(reposListDeploymentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListDeployments( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateDeploymentBodySchema = z.object({ - ref: z.coerce.string(), - task: z.coerce.string().optional(), - auto_merge: z.coerce.boolean().optional(), - required_contexts: z.array(z.coerce.string()).optional(), - payload: z.union([z.object({}), z.coerce.string()]), - environment: z.coerce.string().optional(), - description: z.coerce.string().optional(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateDeployment", - "/repos/:owner/:repo/deployments", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateDeploymentParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateDeploymentBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateDeployment( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -64271,1352 +65175,447 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 202) { - ctx.body = z - .object({ message: z.coerce.string().optional() }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - router.get( - "reposGetDeployment", - "/repos/:owner/:repo/deployments/:deploymentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetDeploymentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetDeployment( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteDeployment", - "/repos/:owner/:repo/deployments/:deploymentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteDeploymentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteDeployment( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposListDeploymentStatusesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - const reposListDeploymentStatusesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListDeploymentStatuses", - "/repos/:owner/:repo/deployments/:deploymentId/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListDeploymentStatusesParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListDeploymentStatusesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.reposListDeploymentStatuses( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateDeploymentStatusParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - const reposCreateDeploymentStatusBodySchema = z.object({ - state: z.enum([ - "error", - "failure", - "inactive", - "in_progress", - "queued", - "pending", - "success", - ]), - target_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - environment: z.enum(["production", "staging", "qa"]).optional(), - environment_url: z.coerce.string().optional(), - auto_inactive: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateDeploymentStatus", - "/repos/:owner/:repo/deployments/:deploymentId/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateDeploymentStatusParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateDeploymentStatusBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposCreateDeploymentStatus( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetDeploymentStatusParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - status_id: z.coerce.number(), - }) - - router.get( - "reposGetDeploymentStatus", - "/repos/:owner/:repo/deployments/:deploymentId/statuses/:statusId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetDeploymentStatusParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetDeploymentStatus( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateDispatchEventParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateDispatchEventBodySchema = z.object({ - event_type: z.coerce.string(), - client_payload: z.object({}).optional(), - }) - - router.post( - "reposCreateDispatchEvent", - "/repos/:owner/:repo/dispatches", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateDispatchEventParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateDispatchEventBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateDispatchEvent( - input, - ctx - ) - - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetAllEnvironmentsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposGetAllEnvironmentsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposGetAllEnvironments", - "/repos/:owner/:repo/environments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAllEnvironmentsParamSchema, - ctx.params - ), - query: parseRequestInput(reposGetAllEnvironmentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposGetAllEnvironments( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number().optional(), - environments: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetEnvironmentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - router.get( - "reposGetEnvironment", - "/repos/:owner/:repo/environments/:environmentName", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetEnvironmentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetEnvironment( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateOrUpdateEnvironmentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - const reposCreateOrUpdateEnvironmentBodySchema = z - .object({ - wait_timer: z.coerce.number().optional(), - reviewers: z - .array( - z.object({ - type: z.enum(["User", "Team"]).optional(), - id: z.coerce.number().optional(), - }) - ) - .optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - .optional() - - router.put( - "reposCreateOrUpdateEnvironment", - "/repos/:owner/:repo/environments/:environmentName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateOrUpdateEnvironmentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateOrUpdateEnvironmentBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposCreateOrUpdateEnvironment(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteAnEnvironmentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - router.delete( - "reposDeleteAnEnvironment", - "/repos/:owner/:repo/environments/:environmentName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteAnEnvironmentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteAnEnvironment( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const reposListDeploymentBranchPoliciesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - const reposListDeploymentBranchPoliciesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListDeploymentBranchPolicies", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListDeploymentBranchPoliciesParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListDeploymentBranchPoliciesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListDeploymentBranchPolicies(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - branch_policies: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - const reposCreateDeploymentBranchPolicyBodySchema = z.object({ - name: z.coerce.string(), - }) - - router.post( - "reposCreateDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateDeploymentBranchPolicyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposCreateDeploymentBranchPolicy(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - branch_policy_id: z.coerce.number(), - }) - - router.get( - "reposGetDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetDeploymentBranchPolicy(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUpdateDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - branch_policy_id: z.coerce.number(), - }) - - const reposUpdateDeploymentBranchPolicyBodySchema = z.object({ - name: z.coerce.string(), - }) - - router.put( - "reposUpdateDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdateDeploymentBranchPolicyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdateDeploymentBranchPolicy(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - branch_policy_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) - - ctx.status = status - return next() - } - ) - - const activityListRepoEventsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const activityListRepoEventsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListRepoEvents", - "/repos/:owner/:repo/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListRepoEventsParamSchema, - ctx.params - ), - query: parseRequestInput(activityListRepoEventsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.activityListRepoEvents( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -65638,340 +65637,215 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z + }) + .optional(), + forks: z.coerce.number(), + permissions: z .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z + full_name: z.coerce.string().optional(), + owner: z .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -65993,269 +65867,187 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - }) - .optional(), - comment: z - .object({ + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListForksParamSchema = z.object({ + const reposGetCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + ref: z.coerce.string(), }) - const reposListForksQuerySchema = z.object({ - sort: z.enum(["newest", "oldest", "stargazers", "watchers"]).optional(), - per_page: z.coerce.number().optional(), + const reposGetCommitQuerySchema = z.object({ page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), }) router.get( - "reposListForks", - "/repos/:owner/:repo/forks", + "reposGetCommit", + "/repos/:owner/:repo/commits/:ref", async (ctx, next) => { const input = { - params: parseRequestInput(reposListForksParamSchema, ctx.params), - query: parseRequestInput(reposListForksQuerySchema, ctx.query), + params: parseRequestInput(reposGetCommitParamSchema, ctx.params), + query: parseRequestInput(reposGetCommitQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposListForks(input, ctx) + const { status, body } = await implementation.reposGetCommit(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), + url: z.coerce.string(), + sha: z.coerce.string(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -66278,507 +66070,548 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + ), + stats: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateForkParamSchema = z.object({ + const checksListForRefParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + ref: z.coerce.string(), }) - const reposCreateForkBodySchema = z - .object({ - organization: z.coerce.string().optional(), - name: z.coerce.string().optional(), - default_branch_only: z.coerce.boolean().optional(), - }) - .optional() + const checksListForRefQuerySchema = z.object({ + check_name: z.coerce.string().optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + filter: z.enum(["latest", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + app_id: z.coerce.number().optional(), + }) - router.post( - "reposCreateFork", - "/repos/:owner/:repo/forks", + router.get( + "checksListForRef", + "/repos/:owner/:repo/commits/:ref/check-runs", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreateForkParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateForkBodySchema, ctx.body), + params: parseRequestInput(checksListForRefParamSchema, ctx.params), + query: parseRequestInput(checksListForRefQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposCreateFork(input, ctx) + const { status, body } = await implementation.checksListForRef(input, ctx) - if (status === 202) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksListSuitesForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const checksListSuitesForRefQuerySchema = z.object({ + app_id: z.coerce.number().optional(), + check_name: z.coerce.string().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "checksListSuitesForRef", + "/repos/:owner/:repo/commits/:ref/check-suites", + async (ctx, next) => { + const input = { + params: parseRequestInput( + checksListSuitesForRefParamSchema, + ctx.params + ), + query: parseRequestInput(checksListSuitesForRefQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.checksListSuitesForRef( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_suites: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), clone_url: z.coerce.string().optional(), mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), svn_url: z.coerce.string().optional(), homepage: z.coerce.string().optional(), language: z.coerce.string().optional(), @@ -66795,12 +66628,22 @@ export function bootstrap( has_wiki: z.coerce.boolean().optional(), has_pages: z.coerce.boolean().optional(), has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), archived: z.coerce.boolean().optional(), disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), permissions: z .object({ admin: z.coerce.boolean().optional(), @@ -66810,167 +66653,144 @@ export function bootstrap( pull: z.coerce.boolean().optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), + role_name: z.coerce.string().optional(), temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + ), }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCombinedStatusForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const reposGetCombinedStatusForRefQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposGetCombinedStatusForRef", + "/repos/:owner/:repo/commits/:ref/status", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCombinedStatusForRefParamSchema, + ctx.params + ), + query: parseRequestInput( + reposGetCombinedStatusForRefQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposGetCombinedStatusForRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + state: z.coerce.string(), + statuses: z.array( + z.object({ + description: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + context: z.coerce.string(), + target_url: z.coerce.string(), + required: z.coerce.boolean().optional(), + avatar_url: z.coerce.string(), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + sha: z.coerce.string(), + total_count: z.coerce.number(), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -67016,7 +66836,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -67028,7 +66848,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -67036,199 +66856,248 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), + role_name: z.coerce.string().optional(), temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), allow_forking: z.coerce.boolean().optional(), web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + commit_url: z.coerce.string(), + url: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListCommitStatusesForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const reposListCommitStatusesForRefQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListCommitStatusesForRef", + "/repos/:owner/:repo/commits/:ref/statuses", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCommitStatusesForRefParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommitStatusesForRefQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListCommitStatusesForRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCommunityProfileMetricsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetCommunityProfileMetrics", + "/repos/:owner/:repo/community/profile", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCommunityProfileMetricsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetCommunityProfileMetrics(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + health_percentage: z.coerce.number(), + description: z.coerce.string(), + documentation: z.coerce.string(), + files: z.object({ + code_of_conduct: z.object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }), + code_of_conduct_file: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), license: z.object({ key: z.coerce.string(), name: z.coerce.string(), @@ -67237,42 +67106,105 @@ export function bootstrap( node_id: z.coerce.string(), html_url: z.coerce.string().optional(), }), - organization: z - .object({ + contributing: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + readme: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + issue_template: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + pull_request_template: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + content_reports_enabled: z.coerce.boolean().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCompareCommitsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + basehead: z.coerce.string(), + }) + + const reposCompareCommitsQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + router.get( + "reposCompareCommits", + "/repos/:owner/:repo/compare/:basehead", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCompareCommitsParamSchema, ctx.params), + query: parseRequestInput(reposCompareCommitsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposCompareCommits( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + permalink_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + base_commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -67295,3358 +67227,4416 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + merge_base_commit: z.object({ url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), }) - .optional(), - secret_scanning: z + ), + stats: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), }) .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) .optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + }), + status: z.enum(["diverged", "ahead", "behind", "identical"]), + ahead_by: z.coerce.number(), + behind_by: z.coerce.number(), + total_commits: z.coerce.number(), + commits: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), }) - ) - .optional(), - }) - .parse(body) - } - + ), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitCreateBlobParamSchema = z.object({ + const reposGetContentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + path: z.coerce.string(), }) - const gitCreateBlobBodySchema = z.object({ - content: z.coerce.string(), - encoding: z.coerce.string().optional(), + const reposGetContentQuerySchema = z.object({ + ref: z.coerce.string().optional(), }) - router.post( - "gitCreateBlob", - "/repos/:owner/:repo/git/blobs", + router.get( + "reposGetContent", + "/repos/:owner/:repo/contents/:path", async (ctx, next) => { const input = { - params: parseRequestInput(gitCreateBlobParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitCreateBlobBodySchema, ctx.body), + params: parseRequestInput(reposGetContentParamSchema, ctx.params), + query: parseRequestInput(reposGetContentQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.gitCreateBlob(input, ctx) + const { status, body } = await implementation.reposGetContent(input, ctx) - if (status === 201) { - ctx.body = z - .object({ url: z.coerce.string(), sha: z.coerce.string() }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.union([ + z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + type: z.enum(["dir", "file", "submodule", "symlink"]), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string().optional(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), }) - ) - .optional(), - }) - .parse(body) - } - + ), + z.object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), + }), + z.object({ + type: z.enum(["symlink"]), + target: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + }), + z.object({ + type: z.enum(["submodule"]), + submodule_git_url: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + }), + ]), + ], + ["302", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitGetBlobParamSchema = z.object({ + const reposCreateOrUpdateFileContentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - file_sha: z.coerce.string(), + path: z.coerce.string(), }) - router.get( - "gitGetBlob", - "/repos/:owner/:repo/git/blobs/:fileSha", + const reposCreateOrUpdateFileContentsBodySchema = z.object({ + message: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + committer: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().optional(), + }) + .optional(), + author: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().optional(), + }) + .optional(), + }) + + router.put( + "reposCreateOrUpdateFileContents", + "/repos/:owner/:repo/contents/:path", async (ctx, next) => { const input = { - params: parseRequestInput(gitGetBlobParamSchema, ctx.params), + params: parseRequestInput( + reposCreateOrUpdateFileContentsParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + reposCreateOrUpdateFileContentsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.gitGetBlob(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - content: z.coerce.string(), - encoding: z.coerce.string(), - url: z.coerce.string(), - sha: z.coerce.string(), - size: z.coerce.number(), - node_id: z.coerce.string(), - highlighted_content: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposCreateOrUpdateFileContents(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), + }), + ], + [ + "201", + z.object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitCreateCommitParamSchema = z.object({ + const reposDeleteFileParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + path: z.coerce.string(), }) - const gitCreateCommitBodySchema = z.object({ + const reposDeleteFileBodySchema = z.object({ message: z.coerce.string(), - tree: z.coerce.string(), - parents: z.array(z.coerce.string()).optional(), - author: z + sha: z.coerce.string(), + branch: z.coerce.string().optional(), + committer: z .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }).optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), }) .optional(), - committer: z + author: z .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - date: z.coerce.string().datetime({ offset: true }).optional(), }) .optional(), - signature: z.coerce.string().optional(), }) - router.post( - "gitCreateCommit", - "/repos/:owner/:repo/git/commits", + router.delete( + "reposDeleteFile", + "/repos/:owner/:repo/contents/:path", async (ctx, next) => { const input = { - params: parseRequestInput(gitCreateCommitParamSchema, ctx.params), + params: parseRequestInput(reposDeleteFileParamSchema, ctx.params), query: undefined, - body: parseRequestInput(gitCreateCommitBodySchema, ctx.body), + body: parseRequestInput(reposDeleteFileBodySchema, ctx.body), } - const { status, body } = await implementation.gitCreateCommit(input, ctx) + const { status, body } = await implementation.reposDeleteFile(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - sha: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - author: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), }), - committer: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - message: z.coerce.string(), - tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - }) - ), - verification: z.object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - signature: z.coerce.string(), - payload: z.coerce.string(), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - html_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitGetCommitParamSchema = z.object({ + const reposListContributorsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - commit_sha: z.coerce.string(), + }) + + const reposListContributorsQuerySchema = z.object({ + anon: z.coerce.string().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "gitGetCommit", - "/repos/:owner/:repo/git/commits/:commitSha", + "reposListContributors", + "/repos/:owner/:repo/contributors", async (ctx, next) => { const input = { - params: parseRequestInput(gitGetCommitParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(reposListContributorsParamSchema, ctx.params), + query: parseRequestInput(reposListContributorsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.gitGetCommit(input, ctx) + const { status, body } = await implementation.reposListContributors( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - sha: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - author: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), - }), - committer: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), - }), - message: z.coerce.string(), - tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), - parents: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - }) - ), - verification: z.object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - signature: z.coerce.string(), - payload: z.coerce.string(), - }), - html_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const gitListMatchingRefsParamSchema = z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string(), + site_admin: z.coerce.boolean().optional(), + contributions: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ), + ], + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotListAlertsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), + }) + + const dependabotListAlertsForRepoQuerySchema = z.object({ + state: z.coerce.string().optional(), + severity: z.coerce.string().optional(), + ecosystem: z.coerce.string().optional(), + package: z.coerce.string().optional(), + manifest: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + first: z.coerce.number().optional(), + last: z.coerce.number().optional(), }) router.get( - "gitListMatchingRefs", - "/repos/:owner/:repo/git/matching-refs/:ref", + "dependabotListAlertsForRepo", + "/repos/:owner/:repo/dependabot/alerts", async (ctx, next) => { const input = { - params: parseRequestInput(gitListMatchingRefsParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + dependabotListAlertsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + dependabotListAlertsForRepoQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.gitListMatchingRefs( + const { status, body } = await implementation.dependabotListAlertsForRepo( input, ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), url: z.coerce.string(), - }), - }) - ) - .parse(body) - } - + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitGetRefParamSchema = z.object({ + const dependabotGetAlertParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), + alert_number: z.coerce.number(), }) router.get( - "gitGetRef", - "/repos/:owner/:repo/git/ref/:ref", + "dependabotGetAlert", + "/repos/:owner/:repo/dependabot/alerts/:alertNumber", async (ctx, next) => { const input = { - params: parseRequestInput(gitGetRefParamSchema, ctx.params), + params: parseRequestInput(dependabotGetAlertParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.gitGetRef(input, ctx) + const { status, body } = await implementation.dependabotGetAlert( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitCreateRefParamSchema = z.object({ + const dependabotUpdateAlertParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + alert_number: z.coerce.number(), }) - const gitCreateRefBodySchema = z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - key: z.coerce.string().optional(), + const dependabotUpdateAlertBodySchema = z.object({ + state: z.enum(["dismissed", "open"]), + dismissed_reason: z + .enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]) + .optional(), + dismissed_comment: z.coerce.string().optional(), }) - router.post( - "gitCreateRef", - "/repos/:owner/:repo/git/refs", + router.patch( + "dependabotUpdateAlert", + "/repos/:owner/:repo/dependabot/alerts/:alertNumber", async (ctx, next) => { const input = { - params: parseRequestInput(gitCreateRefParamSchema, ctx.params), + params: parseRequestInput(dependabotUpdateAlertParamSchema, ctx.params), query: undefined, - body: parseRequestInput(gitCreateRefBodySchema, ctx.body), + body: parseRequestInput(dependabotUpdateAlertBodySchema, ctx.body), } - const { status, body } = await implementation.gitCreateRef(input, ctx) + const { status, body } = await implementation.dependabotUpdateAlert( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitUpdateRefParamSchema = z.object({ + const dependabotListRepoSecretsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), }) - const gitUpdateRefBodySchema = z.object({ - sha: z.coerce.string(), - force: z.coerce.boolean().optional(), + const dependabotListRepoSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.patch( - "gitUpdateRef", - "/repos/:owner/:repo/git/refs/:ref", + router.get( + "dependabotListRepoSecrets", + "/repos/:owner/:repo/dependabot/secrets", async (ctx, next) => { const input = { - params: parseRequestInput(gitUpdateRefParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitUpdateRefBodySchema, ctx.body), + params: parseRequestInput( + dependabotListRepoSecretsParamSchema, + ctx.params + ), + query: parseRequestInput( + dependabotListRepoSecretsQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.gitUpdateRef(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + const { status, body } = await implementation.dependabotListRepoSecrets( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }) - ) - .optional(), - }) - .parse(body) - } - + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitDeleteRefParamSchema = z.object({ + const dependabotGetRepoPublicKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), }) - router.delete( - "gitDeleteRef", - "/repos/:owner/:repo/git/refs/:ref", + router.get( + "dependabotGetRepoPublicKey", + "/repos/:owner/:repo/dependabot/secrets/public-key", async (ctx, next) => { const input = { - params: parseRequestInput(gitDeleteRefParamSchema, ctx.params), + params: parseRequestInput( + dependabotGetRepoPublicKeyParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.gitDeleteRef(input, ctx) - - if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = await implementation.dependabotGetRepoPublicKey( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ key_id: z.coerce.string(), key: z.coerce.string() }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitCreateTagParamSchema = z.object({ + const dependabotGetRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + secret_name: z.coerce.string(), }) - const gitCreateTagBodySchema = z.object({ - tag: z.coerce.string(), - message: z.coerce.string(), - object: z.coerce.string(), - type: z.enum(["commit", "tree", "blob"]), - tagger: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional(), - }) - - router.post( - "gitCreateTag", - "/repos/:owner/:repo/git/tags", + router.get( + "dependabotGetRepoSecret", + "/repos/:owner/:repo/dependabot/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput(gitCreateTagParamSchema, ctx.params), + params: parseRequestInput( + dependabotGetRepoSecretParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(gitCreateTagBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.gitCreateTag(input, ctx) + const { status, body } = await implementation.dependabotGetRepoSecret( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - node_id: z.coerce.string(), - tag: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - message: z.coerce.string(), - tagger: z.object({ - date: z.coerce.string(), - email: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }), - object: z.object({ - sha: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitGetTagParamSchema = z.object({ + const dependabotCreateOrUpdateRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - tag_sha: z.coerce.string(), + secret_name: z.coerce.string(), }) - router.get( - "gitGetTag", - "/repos/:owner/:repo/git/tags/:tagSha", + const dependabotCreateOrUpdateRepoSecretBodySchema = z.object({ + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string().optional(), + }) + + router.put( + "dependabotCreateOrUpdateRepoSecret", + "/repos/:owner/:repo/dependabot/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput(gitGetTagParamSchema, ctx.params), + params: parseRequestInput( + dependabotCreateOrUpdateRepoSecretParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + dependabotCreateOrUpdateRepoSecretBodySchema, + ctx.body + ), } - const { status, body } = await implementation.gitGetTag(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - node_id: z.coerce.string(), - tag: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - message: z.coerce.string(), - tagger: z.object({ - date: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - }), - object: z.object({ - sha: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.dependabotCreateOrUpdateRepoSecret(input, ctx) + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const gitCreateTreeParamSchema = z.object({ + const dependabotDeleteRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + secret_name: z.coerce.string(), }) - const gitCreateTreeBodySchema = z.object({ - tree: z.array( - z.object({ - path: z.coerce.string().optional(), - mode: z - .enum(["100644", "100755", "040000", "160000", "120000"]) - .optional(), - type: z.enum(["blob", "tree", "commit"]).optional(), - sha: z.coerce.string().optional(), - content: z.coerce.string().optional(), - }) - ), - base_tree: z.coerce.string().optional(), - }) - - router.post( - "gitCreateTree", - "/repos/:owner/:repo/git/trees", + router.delete( + "dependabotDeleteRepoSecret", + "/repos/:owner/:repo/dependabot/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput(gitCreateTreeParamSchema, ctx.params), + params: parseRequestInput( + dependabotDeleteRepoSecretParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(gitCreateTreeBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.gitCreateTree(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - sha: z.coerce.string(), - url: z.coerce.string(), - truncated: z.coerce.boolean(), - tree: z.array( - z.object({ - path: z.coerce.string().optional(), - mode: z.coerce.string().optional(), - type: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = await implementation.dependabotDeleteRepoSecret( + input, + ctx + ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const gitGetTreeParamSchema = z.object({ + const dependencyGraphDiffRangeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - tree_sha: z.coerce.string(), + basehead: z.coerce.string(), }) - const gitGetTreeQuerySchema = z.object({ - recursive: z.coerce.string().optional(), + const dependencyGraphDiffRangeQuerySchema = z.object({ + name: z.coerce.string().optional(), }) router.get( - "gitGetTree", - "/repos/:owner/:repo/git/trees/:treeSha", + "dependencyGraphDiffRange", + "/repos/:owner/:repo/dependency-graph/compare/:basehead", async (ctx, next) => { const input = { - params: parseRequestInput(gitGetTreeParamSchema, ctx.params), - query: parseRequestInput(gitGetTreeQuerySchema, ctx.query), + params: parseRequestInput( + dependencyGraphDiffRangeParamSchema, + ctx.params + ), + query: parseRequestInput( + dependencyGraphDiffRangeQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.gitGetTree(input, ctx) + const { status, body } = await implementation.dependencyGraphDiffRange( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - sha: z.coerce.string(), - url: z.coerce.string(), - truncated: z.coerce.boolean(), - tree: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - path: z.coerce.string().optional(), - mode: z.coerce.string().optional(), - type: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), + change_type: z.enum(["added", "removed"]), + manifest: z.coerce.string(), + ecosystem: z.coerce.string(), + name: z.coerce.string(), + version: z.coerce.string(), + package_url: z.coerce.string(), + license: z.coerce.string(), + source_repository_url: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + severity: z.coerce.string(), + advisory_ghsa_id: z.coerce.string(), + advisory_summary: z.coerce.string(), + advisory_url: z.coerce.string(), + }) + ), + scope: z.enum(["unknown", "runtime", "development"]), }) ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListWebhooksParamSchema = z.object({ + const dependencyGraphCreateRepositorySnapshotParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposListWebhooksQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const dependencyGraphCreateRepositorySnapshotBodySchema = z.object({ + version: z.coerce.number(), + job: z.object({ + id: z.coerce.string(), + correlator: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + sha: z.coerce.string(), + ref: z.coerce.string(), + detector: z.object({ + name: z.coerce.string(), + version: z.coerce.string(), + url: z.coerce.string(), + }), + metadata: z.object({}).optional(), + manifests: z.object({}).optional(), + scanned: z.coerce.string().datetime({ offset: true }), }) - router.get( - "reposListWebhooks", - "/repos/:owner/:repo/hooks", + router.post( + "dependencyGraphCreateRepositorySnapshot", + "/repos/:owner/:repo/dependency-graph/snapshots", async (ctx, next) => { const input = { - params: parseRequestInput(reposListWebhooksParamSchema, ctx.params), - query: parseRequestInput(reposListWebhooksQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput( + dependencyGraphCreateRepositorySnapshotParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + dependencyGraphCreateRepositorySnapshotBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposListWebhooks( - input, - ctx - ) + const { status, body } = + await implementation.dependencyGraphCreateRepositorySnapshot(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ - type: z.coerce.string(), id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + created_at: z.coerce.string(), + result: z.coerce.string(), + message: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateWebhookParamSchema = z.object({ + const reposListDeploymentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposCreateWebhookBodySchema = z - .object({ - name: z.coerce.string().optional(), - config: z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - token: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - active: z.coerce.boolean().optional(), - }) - .optional() + const reposListDeploymentsQuerySchema = z.object({ + sha: z.coerce.string().optional(), + ref: z.coerce.string().optional(), + task: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - router.post( - "reposCreateWebhook", - "/repos/:owner/:repo/hooks", + router.get( + "reposListDeployments", + "/repos/:owner/:repo/deployments", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreateWebhookParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateWebhookBodySchema, ctx.body), + params: parseRequestInput(reposListDeploymentsParamSchema, ctx.params), + query: parseRequestInput(reposListDeploymentsQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposCreateWebhook( + const { status, body } = await implementation.reposListDeployments( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetWebhookParamSchema = z.object({ + const reposCreateDeploymentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), }) - router.get( - "reposGetWebhook", - "/repos/:owner/:repo/hooks/:hookId", + const reposCreateDeploymentBodySchema = z.object({ + ref: z.coerce.string(), + task: z.coerce.string().optional(), + auto_merge: z.coerce.boolean().optional(), + required_contexts: z.array(z.coerce.string()).optional(), + payload: z.union([z.object({}), z.coerce.string()]), + environment: z.coerce.string().optional(), + description: z.coerce.string().optional(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateDeployment", + "/repos/:owner/:repo/deployments", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetWebhookParamSchema, ctx.params), + params: parseRequestInput(reposCreateDeploymentParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(reposCreateDeploymentBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetWebhook(input, ctx) + const { status, body } = await implementation.reposCreateDeployment( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), + ], + ["202", z.object({ message: z.coerce.string().optional() })], + ["409", z.void()], + [ + "422", + z.object({ message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposUpdateWebhookParamSchema = z.object({ + const reposGetDeploymentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - const reposUpdateWebhookBodySchema = z.object({ - config: z - .object({ - url: z.coerce.string(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - address: z.coerce.string().optional(), - room: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - add_events: z.array(z.coerce.string()).optional(), - remove_events: z.array(z.coerce.string()).optional(), - active: z.coerce.boolean().optional(), + deployment_id: z.coerce.number(), }) - router.patch( - "reposUpdateWebhook", - "/repos/:owner/:repo/hooks/:hookId", + router.get( + "reposGetDeployment", + "/repos/:owner/:repo/deployments/:deploymentId", async (ctx, next) => { const input = { - params: parseRequestInput(reposUpdateWebhookParamSchema, ctx.params), + params: parseRequestInput(reposGetDeploymentParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposUpdateWebhookBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reposUpdateWebhook( + const { status, body } = await implementation.reposGetDeployment( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeleteWebhookParamSchema = z.object({ + const reposDeleteDeploymentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), + deployment_id: z.coerce.number(), }) router.delete( - "reposDeleteWebhook", - "/repos/:owner/:repo/hooks/:hookId", + "reposDeleteDeployment", + "/repos/:owner/:repo/deployments/:deploymentId", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeleteWebhookParamSchema, ctx.params), + params: parseRequestInput(reposDeleteDeploymentParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposDeleteWebhook( + const { status, body } = await implementation.reposDeleteDeployment( input, ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetWebhookConfigForRepoParamSchema = z.object({ + const reposListDeploymentStatusesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), + deployment_id: z.coerce.number(), + }) + + const reposListDeploymentStatusesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetWebhookConfigForRepo", - "/repos/:owner/:repo/hooks/:hookId/config", + "reposListDeploymentStatuses", + "/repos/:owner/:repo/deployments/:deploymentId/statuses", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetWebhookConfigForRepoParamSchema, + reposListDeploymentStatusesParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + reposListDeploymentStatusesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = - await implementation.reposGetWebhookConfigForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .parse(body) - } + const { status, body } = await implementation.reposListDeploymentStatuses( + input, + ctx + ) - ctx.status = status - return next() - } - ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const reposUpdateWebhookConfigForRepoParamSchema = z.object({ + const reposCreateDeploymentStatusParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), + deployment_id: z.coerce.number(), }) - const reposUpdateWebhookConfigForRepoBodySchema = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .optional() + const reposCreateDeploymentStatusBodySchema = z.object({ + state: z.enum([ + "error", + "failure", + "inactive", + "in_progress", + "queued", + "pending", + "success", + ]), + target_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + environment: z.enum(["production", "staging", "qa"]).optional(), + environment_url: z.coerce.string().optional(), + auto_inactive: z.coerce.boolean().optional(), + }) - router.patch( - "reposUpdateWebhookConfigForRepo", - "/repos/:owner/:repo/hooks/:hookId/config", + router.post( + "reposCreateDeploymentStatus", + "/repos/:owner/:repo/deployments/:deploymentId/statuses", async (ctx, next) => { const input = { params: parseRequestInput( - reposUpdateWebhookConfigForRepoParamSchema, + reposCreateDeploymentStatusParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - reposUpdateWebhookConfigForRepoBodySchema, + reposCreateDeploymentStatusBodySchema, ctx.body ), } - const { status, body } = - await implementation.reposUpdateWebhookConfigForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .parse(body) - } + const { status, body } = await implementation.reposCreateDeploymentStatus( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListWebhookDeliveriesParamSchema = z.object({ + const reposGetDeploymentStatusParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - const reposListWebhookDeliveriesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - cursor: z.coerce.string().optional(), - redelivery: z.coerce.boolean().optional(), + deployment_id: z.coerce.number(), + status_id: z.coerce.number(), }) router.get( - "reposListWebhookDeliveries", - "/repos/:owner/:repo/hooks/:hookId/deliveries", + "reposGetDeploymentStatus", + "/repos/:owner/:repo/deployments/:deploymentId/statuses/:statusId", async (ctx, next) => { const input = { params: parseRequestInput( - reposListWebhookDeliveriesParamSchema, + reposGetDeploymentStatusParamSchema, ctx.params ), - query: parseRequestInput( - reposListWebhookDeliveriesQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListWebhookDeliveries( + const { status, body } = await implementation.reposGetDeploymentStatus( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ + url: z.coerce.string(), id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetWebhookDeliveryParamSchema = z.object({ + const reposCreateDispatchEventParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), - delivery_id: z.coerce.number(), }) - router.get( - "reposGetWebhookDelivery", - "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId", + const reposCreateDispatchEventBodySchema = z.object({ + event_type: z.coerce.string(), + client_payload: z.object({}).optional(), + }) + + router.post( + "reposCreateDispatchEvent", + "/repos/:owner/:repo/dispatches", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetWebhookDeliveryParamSchema, + reposCreateDispatchEventParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(reposCreateDispatchEventBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetWebhookDelivery( + const { status, body } = await implementation.reposCreateDispatchEvent( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - url: z.coerce.string().optional(), - request: z.object({ headers: z.object({}), payload: z.object({}) }), - response: z.object({ - headers: z.object({}), - payload: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposRedeliverWebhookDeliveryParamSchema = z.object({ + const reposGetAllEnvironmentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), - delivery_id: z.coerce.number(), }) - router.post( - "reposRedeliverWebhookDelivery", - "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId/attempts", + const reposGetAllEnvironmentsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposGetAllEnvironments", + "/repos/:owner/:repo/environments", async (ctx, next) => { const input = { params: parseRequestInput( - reposRedeliverWebhookDeliveryParamSchema, + reposGetAllEnvironmentsParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput(reposGetAllEnvironmentsQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposRedeliverWebhookDelivery(input, ctx) - - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = await implementation.reposGetAllEnvironments( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number().optional(), + environments: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposPingWebhookParamSchema = z.object({ + const reposGetEnvironmentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - router.post( - "reposPingWebhook", - "/repos/:owner/:repo/hooks/:hookId/pings", + router.get( + "reposGetEnvironment", + "/repos/:owner/:repo/environments/:environmentName", async (ctx, next) => { const input = { - params: parseRequestInput(reposPingWebhookParamSchema, ctx.params), + params: parseRequestInput(reposGetEnvironmentParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposPingWebhook(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.reposGetEnvironment( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposTestPushWebhookParamSchema = z.object({ + const reposCreateOrUpdateEnvironmentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - hook_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - router.post( - "reposTestPushWebhook", - "/repos/:owner/:repo/hooks/:hookId/tests", + const reposCreateOrUpdateEnvironmentBodySchema = z + .object({ + wait_timer: z.coerce.number().optional(), + reviewers: z + .array( + z.object({ + type: z.enum(["User", "Team"]).optional(), + id: z.coerce.number().optional(), + }) + ) + .optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + .optional() + + router.put( + "reposCreateOrUpdateEnvironment", + "/repos/:owner/:repo/environments/:environmentName", async (ctx, next) => { const input = { - params: parseRequestInput(reposTestPushWebhookParamSchema, ctx.params), + params: parseRequestInput( + reposCreateOrUpdateEnvironmentParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + reposCreateOrUpdateEnvironmentBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposTestPushWebhook( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposCreateOrUpdateEnvironment(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsGetImportStatusParamSchema = z.object({ + const reposDeleteAnEnvironmentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + environment_name: z.coerce.string(), }) - router.get( - "migrationsGetImportStatus", - "/repos/:owner/:repo/import", + router.delete( + "reposDeleteAnEnvironment", + "/repos/:owner/:repo/environments/:environmentName", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsGetImportStatusParamSchema, + reposDeleteAnEnvironmentParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.migrationsGetImportStatus( + const { status, body } = await implementation.reposDeleteAnEnvironment( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const migrationsStartImportParamSchema = z.object({ + const reposListDeploymentBranchPoliciesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + environment_name: z.coerce.string(), }) - const migrationsStartImportBodySchema = z.object({ - vcs_url: z.coerce.string(), - vcs: z.enum(["subversion", "git", "mercurial", "tfvc"]).optional(), - vcs_username: z.coerce.string().optional(), - vcs_password: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), + const reposListDeploymentBranchPoliciesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.put( - "migrationsStartImport", - "/repos/:owner/:repo/import", + router.get( + "reposListDeploymentBranchPolicies", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", async (ctx, next) => { const input = { - params: parseRequestInput(migrationsStartImportParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(migrationsStartImportBodySchema, ctx.body), + params: parseRequestInput( + reposListDeploymentBranchPoliciesParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListDeploymentBranchPoliciesQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.migrationsStartImport( - input, - ctx - ) + const { status, body } = + await implementation.reposListDeploymentBranchPolicies(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + branch_policies: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsUpdateImportParamSchema = z.object({ + const reposCreateDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + environment_name: z.coerce.string(), }) - const migrationsUpdateImportBodySchema = z - .object({ - vcs_username: z.coerce.string().optional(), - vcs_password: z.coerce.string().optional(), - vcs: z.enum(["subversion", "tfvc", "git", "mercurial"]).optional(), - tfvc_project: z.coerce.string().optional(), - }) - .optional() + const reposCreateDeploymentBranchPolicyBodySchema = z.object({ + name: z.coerce.string(), + }) - router.patch( - "migrationsUpdateImport", - "/repos/:owner/:repo/import", + router.post( + "reposCreateDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsUpdateImportParamSchema, + reposCreateDeploymentBranchPolicyParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(migrationsUpdateImportBodySchema, ctx.body), + body: parseRequestInput( + reposCreateDeploymentBranchPolicyBodySchema, + ctx.body + ), } - const { status, body } = await implementation.migrationsUpdateImport( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposCreateDeploymentBranchPolicy(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }), + ], + ["303", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsCancelImportParamSchema = z.object({ + const reposGetDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + environment_name: z.coerce.string(), + branch_policy_id: z.coerce.number(), }) - router.delete( - "migrationsCancelImport", - "/repos/:owner/:repo/import", + router.get( + "reposGetDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsCancelImportParamSchema, + reposGetDeploymentBranchPolicyParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.migrationsCancelImport( - input, - ctx - ) - - if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposGetDeploymentBranchPolicy(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsGetCommitAuthorsParamSchema = z.object({ + const reposUpdateDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + environment_name: z.coerce.string(), + branch_policy_id: z.coerce.number(), }) - const migrationsGetCommitAuthorsQuerySchema = z.object({ - since: z.coerce.number().optional(), + const reposUpdateDeploymentBranchPolicyBodySchema = z.object({ + name: z.coerce.string(), }) - router.get( - "migrationsGetCommitAuthors", - "/repos/:owner/:repo/import/authors", + router.put( + "reposUpdateDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsGetCommitAuthorsParamSchema, + reposUpdateDeploymentBranchPolicyParamSchema, ctx.params ), - query: parseRequestInput( - migrationsGetCommitAuthorsQuerySchema, - ctx.query + query: undefined, + body: parseRequestInput( + reposUpdateDeploymentBranchPolicyBodySchema, + ctx.body ), - body: undefined, } - const { status, body } = await implementation.migrationsGetCommitAuthors( - input, - ctx - ) + const { status, body } = + await implementation.reposUpdateDeploymentBranchPolicy(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - remote_id: z.coerce.string(), - remote_name: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - import_url: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsMapCommitAuthorParamSchema = z.object({ + const reposDeleteDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - author_id: z.coerce.number(), + environment_name: z.coerce.string(), + branch_policy_id: z.coerce.number(), }) - const migrationsMapCommitAuthorBodySchema = z - .object({ - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "migrationsMapCommitAuthor", - "/repos/:owner/:repo/import/authors/:authorId", + router.delete( + "reposDeleteDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsMapCommitAuthorParamSchema, + reposDeleteDeploymentBranchPolicyParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(migrationsMapCommitAuthorBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.migrationsMapCommitAuthor( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - remote_id: z.coerce.string(), - remote_name: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - import_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const migrationsGetLargeFilesParamSchema = z.object({ + const activityListRepoEventsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) + const activityListRepoEventsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + router.get( - "migrationsGetLargeFiles", - "/repos/:owner/:repo/import/large_files", + "activityListRepoEvents", + "/repos/:owner/:repo/events", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsGetLargeFilesParamSchema, + activityListRepoEventsParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput(activityListRepoEventsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.migrationsGetLargeFiles( + const { status, body } = await implementation.activityListRepoEvents( input, ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - ref_name: z.coerce.string(), - path: z.coerce.string(), - oid: z.coerce.string(), - size: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const migrationsSetLfsPreferenceParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const migrationsSetLfsPreferenceBodySchema = z.object({ - use_lfs: z.enum(["opt_in", "opt_out"]), - }) - - router.patch( - "migrationsSetLfsPreference", - "/repos/:owner/:repo/import/lfs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsSetLfsPreferenceParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(migrationsSetLfsPreferenceBodySchema, ctx.body), - } - - const { status, body } = await implementation.migrationsSetLfsPreference( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsGetRepoInstallationParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "appsGetRepoInstallation", - "/repos/:owner/:repo/installation", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsGetRepoInstallationParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.appsGetRepoInstallation( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z.enum(["read", "write"]).optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z.enum(["read", "write"]).optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const interactionsGetRestrictionsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "interactionsGetRestrictionsForRepo", - "/repos/:owner/:repo/interaction-limits", - async (ctx, next) => { - const input = { - params: parseRequestInput( - interactionsGetRestrictionsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.interactionsGetRestrictionsForRepo(input, ctx) - - if (status === 200) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const interactionsSetRestrictionsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const interactionsSetRestrictionsForRepoBodySchema = z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - expiry: z - .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) - .optional(), - }) - - router.put( - "interactionsSetRestrictionsForRepo", - "/repos/:owner/:repo/interaction-limits", - async (ctx, next) => { - const input = { - params: parseRequestInput( - interactionsSetRestrictionsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - interactionsSetRestrictionsForRepoBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.interactionsSetRestrictionsForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - origin: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const interactionsRemoveRestrictionsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "interactionsRemoveRestrictionsForRepo", - "/repos/:owner/:repo/interaction-limits", - async (ctx, next) => { - const input = { - params: parseRequestInput( - interactionsRemoveRestrictionsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) - - ctx.status = status - return next() - } - ) - - const reposListInvitationsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListInvitationsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListInvitations", - "/repos/:owner/:repo/invitations", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListInvitationsParamSchema, ctx.params), - query: parseRequestInput(reposListInvitationsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListInvitations( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + avatar_url: z.coerce.string(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + avatar_url: z.coerce.string(), }) .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUpdateInvitationParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - invitation_id: z.coerce.number(), - }) - - const reposUpdateInvitationBodySchema = z - .object({ - permissions: z - .enum(["read", "write", "maintain", "triage", "admin"]) - .optional(), - }) - .optional() + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) - router.patch( - "reposUpdateInvitation", - "/repos/:owner/:repo/invitations/:invitationId", + const reposListForksParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListForksQuerySchema = z.object({ + sort: z.enum(["newest", "oldest", "stargazers", "watchers"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListForks", + "/repos/:owner/:repo/forks", async (ctx, next) => { const input = { - params: parseRequestInput(reposUpdateInvitationParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateInvitationBodySchema, ctx.body), + params: parseRequestInput(reposListForksParamSchema, ctx.params), + query: parseRequestInput(reposListForksQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposUpdateInvitation( - input, - ctx - ) + const { status, body } = await implementation.reposListForks(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateForkParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposCreateForkBodySchema = z + .object({ + organization: z.coerce.string().optional(), + name: z.coerce.string().optional(), + default_branch_only: z.coerce.boolean().optional(), + }) + .optional() + + router.post( + "reposCreateFork", + "/repos/:owner/:repo/forks", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateForkParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateForkBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateFork(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "202", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), collaborators_url: z.coerce.string(), comments_url: z.coerce.string(), commits_url: z.coerce.string(), @@ -70660,7 +71650,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), + git_url: z.coerce.string(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -70672,7 +71662,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), + ssh_url: z.coerce.string(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -70680,391 +71670,375 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), permissions: z .object({ - admin: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), + push: z.coerce.boolean(), triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), }) .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - key: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - secret_scanning: z + forks: z.coerce.number(), + permissions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), - secret_scanning_push_protection: z + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteInvitationParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - invitation_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteInvitation", - "/repos/:owner/:repo/invitations/:invitationId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteInvitationParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteInvitation( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const issuesListForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesListForRepoQuerySchema = z.object({ - milestone: z.coerce.string().optional(), - state: z.enum(["open", "closed", "all"]).optional(), - assignee: z.coerce.string().optional(), - creator: z.coerce.string().optional(), - mentioned: z.coerce.string().optional(), - labels: z.coerce.string().optional(), - sort: z.enum(["created", "updated", "comments"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListForRepo", - "/repos/:owner/:repo/issues", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListForRepoParamSchema, ctx.params), - query: parseRequestInput(issuesListForRepoQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - milestone: z.object({ + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string().optional(), }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z + organization: z .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -71089,10 +72063,7 @@ export function bootstrap( starred_at: z.coerce.string().optional(), }) .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z + parent: z .object({ id: z.coerce.number(), node_id: z.coerce.string(), @@ -71393,11 +72364,55 @@ export function bootstrap( anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - performed_via_github_app: z + source: z .object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -71421,1559 +72436,1748 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), + private: z.coerce.boolean(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), }) - ) - .optional(), - }) - .parse(body) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateBlobParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateBlobBodySchema = z.object({ + content: z.coerce.string(), + encoding: z.coerce.string().optional(), + }) + + router.post( + "gitCreateBlob", + "/repos/:owner/:repo/git/blobs", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateBlobParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateBlobBodySchema, ctx.body), } + const { status, body } = await implementation.gitCreateBlob(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", z.object({ url: z.coerce.string(), sha: z.coerce.string() })], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesCreateParamSchema = z.object({ + const gitGetBlobParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + file_sha: z.coerce.string(), }) - const issuesCreateBodySchema = z.object({ - title: z.union([z.coerce.string(), z.coerce.number()]), - body: z.coerce.string().optional(), - assignee: z.coerce.string().optional(), - milestone: z.union([z.coerce.string(), z.coerce.number()]), - labels: z - .array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - }), - ]) - ) + router.get( + "gitGetBlob", + "/repos/:owner/:repo/git/blobs/:fileSha", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetBlobParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetBlob(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + content: z.coerce.string(), + encoding: z.coerce.string(), + url: z.coerce.string(), + sha: z.coerce.string(), + size: z.coerce.number(), + node_id: z.coerce.string(), + highlighted_content: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateCommitParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateCommitBodySchema = z.object({ + message: z.coerce.string(), + tree: z.coerce.string(), + parents: z.array(z.coerce.string()).optional(), + author: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }).optional(), + }) .optional(), - assignees: z.array(z.coerce.string()).optional(), + committer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional(), + signature: z.coerce.string().optional(), }) router.post( - "issuesCreate", - "/repos/:owner/:repo/issues", + "gitCreateCommit", + "/repos/:owner/:repo/git/commits", async (ctx, next) => { const input = { - params: parseRequestInput(issuesCreateParamSchema, ctx.params), + params: parseRequestInput(gitCreateCommitParamSchema, ctx.params), query: undefined, - body: parseRequestInput(issuesCreateBodySchema, ctx.body), + body: parseRequestInput(gitCreateCommitBodySchema, ctx.body), } - const { status, body } = await implementation.issuesCreate(input, ctx) + const { status, body } = await implementation.gitCreateCommit(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + sha: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), + author: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + committer: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + message: z.coerce.string(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + parents: z.array( z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + }) + ), + verification: z.object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + signature: z.coerce.string(), + payload: z.coerce.string(), + }), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }), - assignees: z - .array( + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetCommitParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + commit_sha: z.coerce.string(), + }) + + router.get( + "gitGetCommit", + "/repos/:owner/:repo/git/commits/:commitSha", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetCommitParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetCommit(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + sha: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + author: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + committer: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + message: z.coerce.string(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + parents: z.array( z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + sha: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), + ), + verification: z.object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + signature: z.coerce.string(), + payload: z.coerce.string(), + }), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitListMatchingRefsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.get( + "gitListMatchingRefs", + "/repos/:owner/:repo/git/matching-refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitListMatchingRefsParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitListMatchingRefs( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.get( + "gitGetRef", + "/repos/:owner/:repo/git/ref/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetRefParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + sha: z.coerce.string(), + url: z.coerce.string(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateRefBodySchema = z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + key: z.coerce.string().optional(), + }) + + router.post( + "gitCreateRef", + "/repos/:owner/:repo/git/refs", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateRefParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateRefBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitUpdateRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const gitUpdateRefBodySchema = z.object({ + sha: z.coerce.string(), + force: z.coerce.boolean().optional(), + }) + + router.patch( + "gitUpdateRef", + "/repos/:owner/:repo/git/refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitUpdateRefParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitUpdateRefBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitUpdateRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitDeleteRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.delete( + "gitDeleteRef", + "/repos/:owner/:repo/git/refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitDeleteRefParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitDeleteRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateTagParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateTagBodySchema = z.object({ + tag: z.coerce.string(), + message: z.coerce.string(), + object: z.coerce.string(), + type: z.enum(["commit", "tree", "blob"]), + tagger: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional(), + }) + + router.post( + "gitCreateTag", + "/repos/:owner/:repo/git/tags", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateTagParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateTagBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateTag(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + node_id: z.coerce.string(), + tag: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + message: z.coerce.string(), + tagger: z.object({ + date: z.coerce.string(), + email: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + }), + object: z.object({ + sha: z.coerce.string(), + type: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + .optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesListCommentsForRepoParamSchema = z.object({ + const gitGetTagParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const issuesListCommentsForRepoQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + tag_sha: z.coerce.string(), }) router.get( - "issuesListCommentsForRepo", - "/repos/:owner/:repo/issues/comments", + "gitGetTag", + "/repos/:owner/:repo/git/tags/:tagSha", async (ctx, next) => { const input = { - params: parseRequestInput( - issuesListCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - issuesListCommentsForRepoQuerySchema, - ctx.query - ), + params: parseRequestInput(gitGetTagParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.issuesListCommentsForRepo( - input, - ctx - ) + const { status, body } = await implementation.gitGetTag(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), node_id: z.coerce.string(), + tag: z.coerce.string(), + sha: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + message: z.coerce.string(), + tagger: z.object({ + date: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + }), + object: z.object({ + sha: z.coerce.string(), type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + url: z.coerce.string(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z + verification: z .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesGetCommentParamSchema = z.object({ + const gitCreateTreeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - router.get( - "issuesGetComment", - "/repos/:owner/:repo/issues/comments/:commentId", + const gitCreateTreeBodySchema = z.object({ + tree: z.array( + z.object({ + path: z.coerce.string().optional(), + mode: z + .enum(["100644", "100755", "040000", "160000", "120000"]) + .optional(), + type: z.enum(["blob", "tree", "commit"]).optional(), + sha: z.coerce.string().optional(), + content: z.coerce.string().optional(), + }) + ), + base_tree: z.coerce.string().optional(), + }) + + router.post( + "gitCreateTree", + "/repos/:owner/:repo/git/trees", async (ctx, next) => { const input = { - params: parseRequestInput(issuesGetCommentParamSchema, ctx.params), + params: parseRequestInput(gitCreateTreeParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(gitCreateTreeBodySchema, ctx.body), } - const { status, body } = await implementation.issuesGetComment(input, ctx) + const { status, body } = await implementation.gitCreateTree(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + sha: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + truncated: z.coerce.boolean(), + tree: z.array( + z.object({ + path: z.coerce.string().optional(), + mode: z.coerce.string().optional(), + type: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + }) + ), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesUpdateCommentParamSchema = z.object({ + const gitGetTreeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + tree_sha: z.coerce.string(), }) - const issuesUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) + const gitGetTreeQuerySchema = z.object({ + recursive: z.coerce.string().optional(), + }) - router.patch( - "issuesUpdateComment", - "/repos/:owner/:repo/issues/comments/:commentId", + router.get( + "gitGetTree", + "/repos/:owner/:repo/git/trees/:treeSha", async (ctx, next) => { const input = { - params: parseRequestInput(issuesUpdateCommentParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateCommentBodySchema, ctx.body), + params: parseRequestInput(gitGetTreeParamSchema, ctx.params), + query: parseRequestInput(gitGetTreeQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.issuesUpdateComment( - input, - ctx - ) + const { status, body } = await implementation.gitGetTree(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + sha: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + truncated: z.coerce.boolean(), + tree: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + path: z.coerce.string().optional(), + mode: z.coerce.string().optional(), + type: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } - + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesDeleteCommentParamSchema = z.object({ + const reposListWebhooksParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - router.delete( - "issuesDeleteComment", - "/repos/:owner/:repo/issues/comments/:commentId", + const reposListWebhooksQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListWebhooks", + "/repos/:owner/:repo/hooks", async (ctx, next) => { const input = { - params: parseRequestInput(issuesDeleteCommentParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(reposListWebhooksParamSchema, ctx.params), + query: parseRequestInput(reposListWebhooksQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.issuesDeleteComment( + const { status, body } = await implementation.reposListWebhooks( input, ctx ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsListForIssueCommentParamSchema = z.object({ + const reposCreateWebhookParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - const reactionsListForIssueCommentQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const reposCreateWebhookBodySchema = z + .object({ + name: z.coerce.string().optional(), + config: z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + token: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + active: z.coerce.boolean().optional(), + }) + .optional() - router.get( - "reactionsListForIssueComment", - "/repos/:owner/:repo/issues/comments/:commentId/reactions", + router.post( + "reposCreateWebhook", + "/repos/:owner/:repo/hooks", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsListForIssueCommentParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForIssueCommentQuerySchema, - ctx.query - ), - body: undefined, + params: parseRequestInput(reposCreateWebhookParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateWebhookBodySchema, ctx.body), } - const { status, body } = - await implementation.reactionsListForIssueComment(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ + const { status, body } = await implementation.reposCreateWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + type: z.coerce.string(), id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), + updated_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.get( + "reposGetWebhook", + "/repos/:owner/:repo/hooks/:hookId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposGetWebhook(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsCreateForIssueCommentParamSchema = z.object({ + const reposUpdateWebhookParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + hook_id: z.coerce.number(), }) - const reactionsCreateForIssueCommentBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), + const reposUpdateWebhookBodySchema = z.object({ + config: z + .object({ + url: z.coerce.string(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + address: z.coerce.string().optional(), + room: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + add_events: z.array(z.coerce.string()).optional(), + remove_events: z.array(z.coerce.string()).optional(), + active: z.coerce.boolean().optional(), }) - router.post( - "reactionsCreateForIssueComment", - "/repos/:owner/:repo/issues/comments/:commentId/reactions", + router.patch( + "reposUpdateWebhook", + "/repos/:owner/:repo/hooks/:hookId", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsCreateForIssueCommentParamSchema, - ctx.params - ), + params: parseRequestInput(reposUpdateWebhookParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - reactionsCreateForIssueCommentBodySchema, - ctx.body - ), + body: parseRequestInput(reposUpdateWebhookBodySchema, ctx.body), } - const { status, body } = - await implementation.reactionsCreateForIssueComment(input, ctx) + const { status, body } = await implementation.reposUpdateWebhook( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteWebhook", + "/repos/:owner/:repo/hooks/:hookId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposDeleteWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsDeleteForIssueCommentParamSchema = z.object({ + const reposGetWebhookConfigForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), - reaction_id: z.coerce.number(), + hook_id: z.coerce.number(), }) - router.delete( - "reactionsDeleteForIssueComment", - "/repos/:owner/:repo/issues/comments/:commentId/reactions/:reactionId", + router.get( + "reposGetWebhookConfigForRepo", + "/repos/:owner/:repo/hooks/:hookId/config", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsDeleteForIssueCommentParamSchema, + reposGetWebhookConfigForRepoParamSchema, ctx.params ), query: undefined, @@ -72981,973 +74185,1602 @@ export function bootstrap( } const { status, body } = - await implementation.reactionsDeleteForIssueComment(input, ctx) + await implementation.reposGetWebhookConfigForRepo(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesListEventsForRepoParamSchema = z.object({ + const reposUpdateWebhookConfigForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + hook_id: z.coerce.number(), }) - const issuesListEventsForRepoQuerySchema = z.object({ + const reposUpdateWebhookConfigForRepoBodySchema = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .optional() + + router.patch( + "reposUpdateWebhookConfigForRepo", + "/repos/:owner/:repo/hooks/:hookId/config", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdateWebhookConfigForRepoParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposUpdateWebhookConfigForRepoBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposUpdateWebhookConfigForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListWebhookDeliveriesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + const reposListWebhookDeliveriesQuerySchema = z.object({ per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + cursor: z.coerce.string().optional(), + redelivery: z.coerce.boolean().optional(), }) router.get( - "issuesListEventsForRepo", - "/repos/:owner/:repo/issues/events", + "reposListWebhookDeliveries", + "/repos/:owner/:repo/hooks/:hookId/deliveries", async (ctx, next) => { const input = { params: parseRequestInput( - issuesListEventsForRepoParamSchema, + reposListWebhookDeliveriesParamSchema, ctx.params ), - query: parseRequestInput(issuesListEventsForRepoQuerySchema, ctx.query), + query: parseRequestInput( + reposListWebhookDeliveriesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.issuesListEventsForRepo( + const { status, body } = await implementation.reposListWebhookDeliveries( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetWebhookDeliveryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + delivery_id: z.coerce.number(), + }) + + router.get( + "reposGetWebhookDelivery", + "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetWebhookDeliveryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetWebhookDelivery( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - actor: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), event: z.coerce.string(), - commit_id: z.coerce.string(), - commit_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ + headers: z.object({}), + payload: z.object({}), + }), + response: z.object({ + headers: z.object({}), + payload: z.coerce.string(), + }), + }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - label: z - .object({ name: z.coerce.string(), color: z.coerce.string() }) - .optional(), - assignee: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - assigner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - review_requester: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_reviewer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_team: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - .optional(), - dismissed_review: z - .object({ - state: z.coerce.string(), - review_id: z.coerce.number(), - dismissal_message: z.coerce.string(), - dismissal_commit_id: z.coerce.string().optional(), - }) - .optional(), - milestone: z.object({ title: z.coerce.string() }).optional(), - project_card: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - project_url: z.coerce.string(), - project_id: z.coerce.number(), - column_name: z.coerce.string(), - previous_column_name: z.coerce.string().optional(), - }) - .optional(), - rename: z - .object({ from: z.coerce.string(), to: z.coerce.string() }) - .optional(), - author_association: z - .enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]) + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - lock_reason: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRedeliverWebhookDeliveryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + delivery_id: z.coerce.number(), + }) + + router.post( + "reposRedeliverWebhookDelivery", + "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId/attempts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRedeliverWebhookDeliveryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposRedeliverWebhookDelivery(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposPingWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.post( + "reposPingWebhook", + "/repos/:owner/:repo/hooks/:hookId/pings", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposPingWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposPingWebhook(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesGetEventParamSchema = z.object({ + const reposTestPushWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.post( + "reposTestPushWebhook", + "/repos/:owner/:repo/hooks/:hookId/tests", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposTestPushWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposTestPushWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetImportStatusParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - event_id: z.coerce.number(), }) router.get( - "issuesGetEvent", - "/repos/:owner/:repo/issues/events/:eventId", + "migrationsGetImportStatus", + "/repos/:owner/:repo/import", async (ctx, next) => { const input = { - params: parseRequestInput(issuesGetEventParamSchema, ctx.params), + params: parseRequestInput( + migrationsGetImportStatusParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.issuesGetEvent(input, ctx) + const { status, body } = await implementation.migrationsGetImportStatus( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - actor: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), }), - event: z.coerce.string(), - commit_id: z.coerce.string(), - commit_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - issue: z - .object({ + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsStartImportParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsStartImportBodySchema = z.object({ + vcs_url: z.coerce.string(), + vcs: z.enum(["subversion", "git", "mercurial", "tfvc"]).optional(), + vcs_username: z.coerce.string().optional(), + vcs_password: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + }) + + router.put( + "migrationsStartImport", + "/repos/:owner/:repo/import", + async (ctx, next) => { + const input = { + params: parseRequestInput(migrationsStartImportParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(migrationsStartImportBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsStartImport( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsUpdateImportParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsUpdateImportBodySchema = z + .object({ + vcs_username: z.coerce.string().optional(), + vcs_password: z.coerce.string().optional(), + vcs: z.enum(["subversion", "tfvc", "git", "mercurial"]).optional(), + tfvc_project: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "migrationsUpdateImport", + "/repos/:owner/:repo/import", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsUpdateImportParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(migrationsUpdateImportBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsUpdateImport( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsCancelImportParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "migrationsCancelImport", + "/repos/:owner/:repo/import", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsCancelImportParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.migrationsCancelImport( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetCommitAuthorsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsGetCommitAuthorsQuerySchema = z.object({ + since: z.coerce.number().optional(), + }) + + router.get( + "migrationsGetCommitAuthors", + "/repos/:owner/:repo/import/authors", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsGetCommitAuthorsParamSchema, + ctx.params + ), + query: parseRequestInput( + migrationsGetCommitAuthorsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.migrationsGetCommitAuthors( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsMapCommitAuthorParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + author_id: z.coerce.number(), + }) + + const migrationsMapCommitAuthorBodySchema = z + .object({ + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "migrationsMapCommitAuthor", + "/repos/:owner/:repo/import/authors/:authorId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsMapCommitAuthorParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(migrationsMapCommitAuthorBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsMapCommitAuthor( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetLargeFilesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "migrationsGetLargeFiles", + "/repos/:owner/:repo/import/large_files", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsGetLargeFilesParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.migrationsGetLargeFiles( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref_name: z.coerce.string(), + path: z.coerce.string(), + oid: z.coerce.string(), + size: z.coerce.number(), + }) + ), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsSetLfsPreferenceParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsSetLfsPreferenceBodySchema = z.object({ + use_lfs: z.enum(["opt_in", "opt_out"]), + }) + + router.patch( + "migrationsSetLfsPreference", + "/repos/:owner/:repo/import/lfs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsSetLfsPreferenceParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(migrationsSetLfsPreferenceBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsSetLfsPreference( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsGetRepoInstallationParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "appsGetRepoInstallation", + "/repos/:owner/:repo/installation", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsGetRepoInstallationParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.appsGetRepoInstallation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const interactionsGetRestrictionsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "interactionsGetRestrictionsForRepo", + "/repos/:owner/:repo/interaction-limits", + async (ctx, next) => { + const input = { + params: parseRequestInput( + interactionsGetRestrictionsForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.interactionsGetRestrictionsForRepo(input, ctx) + + ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const interactionsSetRestrictionsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const interactionsSetRestrictionsForRepoBodySchema = z.object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + expiry: z + .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) + .optional(), + }) + + router.put( + "interactionsSetRestrictionsForRepo", + "/repos/:owner/:repo/interaction-limits", + async (ctx, next) => { + const input = { + params: parseRequestInput( + interactionsSetRestrictionsForRepoParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + interactionsSetRestrictionsForRepoBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.interactionsSetRestrictionsForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const interactionsRemoveRestrictionsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "interactionsRemoveRestrictionsForRepo", + "/repos/:owner/:repo/interaction-limits", + async (ctx, next) => { + const input = { + params: parseRequestInput( + interactionsRemoveRestrictionsForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListInvitationsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListInvitationsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListInvitations", + "/repos/:owner/:repo/invitations", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListInvitationsParamSchema, ctx.params), + query: parseRequestInput(reposListInvitationsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListInvitations( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -73970,21 +75803,7 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + inviter: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74007,120 +75826,553 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateInvitationParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + invitation_id: z.coerce.number(), + }) + + const reposUpdateInvitationBodySchema = z + .object({ + permissions: z + .enum(["read", "write", "maintain", "triage", "admin"]) + .optional(), + }) + .optional() + + router.patch( + "reposUpdateInvitation", + "/repos/:owner/:repo/invitations/:invitationId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposUpdateInvitationParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateInvitationBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdateInvitation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteInvitationParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + invitation_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteInvitation", + "/repos/:owner/:repo/invitations/:invitationId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteInvitationParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeleteInvitation( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const issuesListForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesListForRepoQuerySchema = z.object({ + milestone: z.coerce.string().optional(), + state: z.enum(["open", "closed", "all"]).optional(), + assignee: z.coerce.string().optional(), + creator: z.coerce.string().optional(), + mentioned: z.coerce.string().optional(), + labels: z.coerce.string().optional(), + sort: z.enum(["created", "updated", "comments"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListForRepo", + "/repos/:owner/:repo/issues", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesListForRepoParamSchema, ctx.params), + query: parseRequestInput(issuesListForRepoQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), repository: z .object({ id: z.coerce.number(), @@ -74498,402 +76750,116 @@ export function bootstrap( }) .optional(), }) - .optional(), - label: z - .object({ name: z.coerce.string(), color: z.coerce.string() }) - .optional(), - assignee: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - assigner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - review_requester: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_reviewer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_team: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - .optional(), - dismissed_review: z - .object({ - state: z.coerce.string(), - review_id: z.coerce.number(), - dismissal_message: z.coerce.string(), - dismissal_commit_id: z.coerce.string().optional(), - }) - .optional(), - milestone: z.object({ title: z.coerce.string() }).optional(), - project_card: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - project_url: z.coerce.string(), - project_id: z.coerce.number(), - column_name: z.coerce.string(), - previous_column_name: z.coerce.string().optional(), - }) - .optional(), - rename: z - .object({ from: z.coerce.string(), to: z.coerce.string() }) - .optional(), - author_association: z - .enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]) - .optional(), - lock_reason: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesGetParamSchema = z.object({ + const issuesCreateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), }) - router.get( - "issuesGet", - "/repos/:owner/:repo/issues/:issueNumber", + const issuesCreateBodySchema = z.object({ + title: z.union([z.coerce.string(), z.coerce.number()]), + body: z.coerce.string().optional(), + assignee: z.coerce.string().optional(), + milestone: z.union([z.coerce.string(), z.coerce.number()]), + labels: z + .array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + }), + ]) + ) + .optional(), + assignees: z.array(z.coerce.string()).optional(), + }) + + router.post( + "issuesCreate", + "/repos/:owner/:repo/issues", async (ctx, next) => { const input = { - params: parseRequestInput(issuesGetParamSchema, ctx.params), + params: parseRequestInput(issuesCreateParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(issuesCreateBodySchema, ctx.body), } - const { status, body } = await implementation.issuesGet(input, ctx) + const { status, body } = await implementation.issuesCreate(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74916,34 +76882,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74965,27 +76918,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -75008,18 +76944,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -75042,468 +76979,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesUpdateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesUpdateBodySchema = z - .object({ - title: z.union([z.coerce.string(), z.coerce.number()]), - body: z.coerce.string().optional(), - assignee: z.coerce.string().optional(), - state: z.enum(["open", "closed"]).optional(), - state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), - milestone: z.union([z.coerce.string(), z.coerce.number()]), - labels: z - .array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - }), - ]) - ) - .optional(), - assignees: z.array(z.coerce.string()).optional(), - }) - .optional() - - router.patch( - "issuesUpdate", - "/repos/:owner/:repo/issues/:issueNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesUpdate(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -75526,111 +77029,60 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -75652,19 +77104,425 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesListCommentsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesListCommentsForRepoQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListCommentsForRepo", + "/repos/:owner/:repo/issues/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + issuesListCommentsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.issuesListCommentsForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -75687,525 +77545,156 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), }) - .optional(), - }) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesAddAssigneesParamSchema = z.object({ + const issuesGetCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + comment_id: z.coerce.number(), }) - const issuesAddAssigneesBodySchema = z - .object({ assignees: z.array(z.coerce.string()).optional() }) - .optional() - - router.post( - "issuesAddAssignees", - "/repos/:owner/:repo/issues/:issueNumber/assignees", + router.get( + "issuesGetComment", + "/repos/:owner/:repo/issues/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(issuesAddAssigneesParamSchema, ctx.params), + params: parseRequestInput(issuesGetCommentParamSchema, ctx.params), query: undefined, - body: parseRequestInput(issuesAddAssigneesBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.issuesAddAssignees( - input, - ctx - ) + const { status, body } = await implementation.issuesGetComment(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -76228,76 +77717,25 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -76319,1030 +77757,97 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesRemoveAssigneesParamSchema = z.object({ + const issuesUpdateCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + comment_id: z.coerce.number(), }) - const issuesRemoveAssigneesBodySchema = z.object({ - assignees: z.array(z.coerce.string()).optional(), - }) + const issuesUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) - router.delete( - "issuesRemoveAssignees", - "/repos/:owner/:repo/issues/:issueNumber/assignees", + router.patch( + "issuesUpdateComment", + "/repos/:owner/:repo/issues/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(issuesRemoveAssigneesParamSchema, ctx.params), + params: parseRequestInput(issuesUpdateCommentParamSchema, ctx.params), query: undefined, - body: parseRequestInput(issuesRemoveAssigneesBodySchema, ctx.body), + body: parseRequestInput(issuesUpdateCommentBodySchema, ctx.body), } - const { status, body } = await implementation.issuesRemoveAssignees( + const { status, body } = await implementation.issuesUpdateComment( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesCheckUserCanBeAssignedToIssueParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - assignee: z.coerce.string(), - }) - - router.get( - "issuesCheckUserCanBeAssignedToIssue", - "/repos/:owner/:repo/issues/:issueNumber/assignees/:assignee", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesCheckUserCanBeAssignedToIssueParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.issuesCheckUserCanBeAssignedToIssue(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesListCommentsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesListCommentsQuerySchema = z.object({ - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListComments", - "/repos/:owner/:repo/issues/:issueNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListCommentsParamSchema, ctx.params), - query: parseRequestInput(issuesListCommentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListComments( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -77441,109 +77946,120 @@ export function bootstrap( rocket: z.coerce.number(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesCreateCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesCreateCommentBodySchema = z.object({ body: z.coerce.string() }) + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) - router.post( - "issuesCreateComment", - "/repos/:owner/:repo/issues/:issueNumber/comments", + const issuesDeleteCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + router.delete( + "issuesDeleteComment", + "/repos/:owner/:repo/issues/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(issuesCreateCommentParamSchema, ctx.params), + params: parseRequestInput(issuesDeleteCommentParamSchema, ctx.params), query: undefined, - body: parseRequestInput(issuesCreateCommentBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.issuesCreateComment( + const { status, body } = await implementation.issuesDeleteComment( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reactionsListForIssueCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const reactionsListForIssueCommentQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reactionsListForIssueComment", + "/repos/:owner/:repo/issues/comments/:commentId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsListForIssueCommentParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForIssueCommentQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reactionsListForIssueComment(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -77566,1859 +78082,2739 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesListEventsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesListEventsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListEvents", - "/repos/:owner/:repo/issues/:issueNumber/events", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListEventsParamSchema, ctx.params), - query: parseRequestInput(issuesListEventsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListEvents(input, ctx) - - if (status === 200) { - ctx.body = z.array(z.object({})).parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesListLabelsOnIssueParamSchema = z.object({ + const reactionsCreateForIssueCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + comment_id: z.coerce.number(), }) - const issuesListLabelsOnIssueQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reactionsCreateForIssueCommentBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) - router.get( - "issuesListLabelsOnIssue", - "/repos/:owner/:repo/issues/:issueNumber/labels", + router.post( + "reactionsCreateForIssueComment", + "/repos/:owner/:repo/issues/comments/:commentId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - issuesListLabelsOnIssueParamSchema, + reactionsCreateForIssueCommentParamSchema, ctx.params ), - query: parseRequestInput(issuesListLabelsOnIssueQuerySchema, ctx.query), - body: undefined, + query: undefined, + body: parseRequestInput( + reactionsCreateForIssueCommentBodySchema, + ctx.body + ), } - const { status, body } = await implementation.issuesListLabelsOnIssue( - input, - ctx - ) + const { status, body } = + await implementation.reactionsCreateForIssueComment(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesAddLabelsParamSchema = z.object({ + const reactionsDeleteForIssueCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + comment_id: z.coerce.number(), + reaction_id: z.coerce.number(), }) - const issuesAddLabelsBodySchema = z.union([ - z.object({ labels: z.array(z.coerce.string()).optional() }), - z.array(z.coerce.string()), - z.object({ - labels: z.array(z.object({ name: z.coerce.string() })).optional(), - }), - z.array(z.object({ name: z.coerce.string() })), - z.coerce.string(), - ]) - - router.post( - "issuesAddLabels", - "/repos/:owner/:repo/issues/:issueNumber/labels", + router.delete( + "reactionsDeleteForIssueComment", + "/repos/:owner/:repo/issues/comments/:commentId/reactions/:reactionId", async (ctx, next) => { const input = { - params: parseRequestInput(issuesAddLabelsParamSchema, ctx.params), + params: parseRequestInput( + reactionsDeleteForIssueCommentParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(issuesAddLabelsBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.issuesAddLabels(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.reactionsDeleteForIssueComment(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const issuesSetLabelsParamSchema = z.object({ + const issuesListEventsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), }) - const issuesSetLabelsBodySchema = z.union([ - z.object({ labels: z.array(z.coerce.string()).optional() }), - z.array(z.coerce.string()), - z.object({ - labels: z.array(z.object({ name: z.coerce.string() })).optional(), - }), - z.array(z.object({ name: z.coerce.string() })), - z.coerce.string(), - ]) + const issuesListEventsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - router.put( - "issuesSetLabels", - "/repos/:owner/:repo/issues/:issueNumber/labels", + router.get( + "issuesListEventsForRepo", + "/repos/:owner/:repo/issues/events", async (ctx, next) => { const input = { - params: parseRequestInput(issuesSetLabelsParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesSetLabelsBodySchema, ctx.body), + params: parseRequestInput( + issuesListEventsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput(issuesListEventsForRepoQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.issuesSetLabels(input, ctx) + const { status, body } = await implementation.issuesListEventsForRepo( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesRemoveAllLabelsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - router.delete( - "issuesRemoveAllLabels", - "/repos/:owner/:repo/issues/:issueNumber/labels", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesRemoveAllLabelsParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesRemoveAllLabels( - input, - ctx - ) - - if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesRemoveLabelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - name: z.coerce.string(), - }) - - router.delete( - "issuesRemoveLabel", - "/repos/:owner/:repo/issues/:issueNumber/labels/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesRemoveLabelParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesRemoveLabel( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 301) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesLockParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesLockBodySchema = z - .object({ - lock_reason: z - .enum(["off-topic", "too heated", "resolved", "spam"]) - .optional(), - }) - .optional() - - router.put( - "issuesLock", - "/repos/:owner/:repo/issues/:issueNumber/lock", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesLockParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesLockBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesLock(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesUnlockParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - router.delete( - "issuesUnlock", - "/repos/:owner/:repo/issues/:issueNumber/lock", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesUnlockParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesUnlock(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsListForIssueParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const reactionsListForIssueQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reactionsListForIssue", - "/repos/:owner/:repo/issues/:issueNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput(reactionsListForIssueParamSchema, ctx.params), - query: parseRequestInput(reactionsListForIssueQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reactionsListForIssue( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsCreateForIssueParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const reactionsCreateForIssueBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) - - router.post( - "reactionsCreateForIssue", - "/repos/:owner/:repo/issues/:issueNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForIssueParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reactionsCreateForIssueBodySchema, ctx.body), - } - - const { status, body } = await implementation.reactionsCreateForIssue( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsDeleteForIssueParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - reaction_id: z.coerce.number(), - }) - - router.delete( - "reactionsDeleteForIssue", - "/repos/:owner/:repo/issues/:issueNumber/reactions/:reactionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsDeleteForIssueParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reactionsDeleteForIssue( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const issuesListEventsForTimelineParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesListEventsForTimelineQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListEventsForTimeline", - "/repos/:owner/:repo/issues/:issueNumber/timeline", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListEventsForTimelineParamSchema, - ctx.params - ), - query: parseRequestInput( - issuesListEventsForTimelineQuerySchema, - ctx.query - ), - body: undefined, - } + actor: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const { status, body } = await implementation.issuesListEventsForTimeline( - input, - ctx - ) + const issuesGetEventParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + event_id: z.coerce.number(), + }) - if (status === 200) { - ctx.body = z.array(z.object({})).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + router.get( + "issuesGetEvent", + "/repos/:owner/:repo/issues/events/:eventId", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesGetEventParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.issuesGetEvent(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + actor: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListDeployKeysParamSchema = z.object({ + const issuesGetParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const reposListDeployKeysQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + issue_number: z.coerce.number(), }) router.get( - "reposListDeployKeys", - "/repos/:owner/:repo/keys", + "issuesGet", + "/repos/:owner/:repo/issues/:issueNumber", async (ctx, next) => { const input = { - params: parseRequestInput(reposListDeployKeysParamSchema, ctx.params), - query: parseRequestInput(reposListDeployKeysQuerySchema, ctx.query), + params: parseRequestInput(issuesGetParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListDeployKeys( - input, - ctx - ) + const { status, body } = await implementation.issuesGet(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), - key: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateDeployKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateDeployKeyBodySchema = z.object({ - title: z.coerce.string().optional(), - key: z.coerce.string(), - read_only: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateDeployKey", - "/repos/:owner/:repo/keys", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateDeployKeyParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateDeployKeyBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateDeployKey( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - key: z.coerce.string(), - url: z.coerce.string(), - title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetDeployKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - key_id: z.coerce.number(), - }) - - router.get( - "reposGetDeployKey", - "/repos/:owner/:repo/keys/:keyId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetDeployKeyParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetDeployKey( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - key: z.coerce.string(), - url: z.coerce.string(), - title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteDeployKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - key_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteDeployKey", - "/repos/:owner/:repo/keys/:keyId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteDeployKeyParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteDeployKey( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const issuesListLabelsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesListLabelsForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListLabelsForRepo", - "/repos/:owner/:repo/labels", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListLabelsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput(issuesListLabelsForRepoQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListLabelsForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesCreateLabelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesCreateLabelBodySchema = z.object({ - name: z.coerce.string(), - color: z.coerce.string().optional(), - description: z.coerce.string().optional(), - }) - - router.post( - "issuesCreateLabel", - "/repos/:owner/:repo/labels", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesCreateLabelParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesCreateLabelBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesCreateLabel( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesGetLabelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.get( - "issuesGetLabel", - "/repos/:owner/:repo/labels/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetLabelParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGetLabel(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesUpdateLabelParamSchema = z.object({ + const issuesUpdateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - name: z.coerce.string(), + issue_number: z.coerce.number(), }) - const issuesUpdateLabelBodySchema = z + const issuesUpdateBodySchema = z .object({ - new_name: z.coerce.string().optional(), - color: z.coerce.string().optional(), - description: z.coerce.string().optional(), + title: z.union([z.coerce.string(), z.coerce.number()]), + body: z.coerce.string().optional(), + assignee: z.coerce.string().optional(), + state: z.enum(["open", "closed"]).optional(), + state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), + milestone: z.union([z.coerce.string(), z.coerce.number()]), + labels: z + .array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + }), + ]) + ) + .optional(), + assignees: z.array(z.coerce.string()).optional(), }) .optional() router.patch( - "issuesUpdateLabel", - "/repos/:owner/:repo/labels/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesUpdateLabelParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateLabelBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesUpdateLabel( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesDeleteLabelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.delete( - "issuesDeleteLabel", - "/repos/:owner/:repo/labels/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesDeleteLabelParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesDeleteLabel( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const reposListLanguagesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposListLanguages", - "/repos/:owner/:repo/languages", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListLanguagesParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposListLanguages( - input, - ctx - ) - - if (status === 200) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposEnableLfsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.put( - "reposEnableLfsForRepo", - "/repos/:owner/:repo/lfs", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposEnableLfsForRepoParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposEnableLfsForRepo( - input, - ctx - ) - - if (status === 202) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDisableLfsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "reposDisableLfsForRepo", - "/repos/:owner/:repo/lfs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDisableLfsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDisableLfsForRepo( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const licensesGetForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "licensesGetForRepo", - "/repos/:owner/:repo/license", - async (ctx, next) => { - const input = { - params: parseRequestInput(licensesGetForRepoParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.licensesGetForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - size: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - git_url: z.coerce.string(), - download_url: z.coerce.string(), - type: z.coerce.string(), - content: z.coerce.string(), - encoding: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposMergeUpstreamParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposMergeUpstreamBodySchema = z.object({ branch: z.coerce.string() }) - - router.post( - "reposMergeUpstream", - "/repos/:owner/:repo/merge-upstream", + "issuesUpdate", + "/repos/:owner/:repo/issues/:issueNumber", async (ctx, next) => { const input = { - params: parseRequestInput(reposMergeUpstreamParamSchema, ctx.params), + params: parseRequestInput(issuesUpdateParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposMergeUpstreamBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposMergeUpstream( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - merge_type: z.enum(["merge", "fast-forward", "none"]).optional(), - base_branch: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposMergeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposMergeBodySchema = z.object({ - base: z.coerce.string(), - head: z.coerce.string(), - commit_message: z.coerce.string().optional(), - }) - - router.post("reposMerge", "/repos/:owner/:repo/merges", async (ctx, next) => { - const input = { - params: parseRequestInput(reposMergeParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposMergeBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposMerge(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const issuesListMilestonesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesListMilestonesQuerySchema = z.object({ - state: z.enum(["open", "closed", "all"]).optional(), - sort: z.enum(["due_on", "completeness"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListMilestones", - "/repos/:owner/:repo/milestones", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListMilestonesParamSchema, ctx.params), - query: parseRequestInput(issuesListMilestonesQuerySchema, ctx.query), - body: undefined, + body: parseRequestInput(issuesUpdateBodySchema, ctx.body), } - const { status, body } = await implementation.issuesListMilestones( - input, - ctx - ) + const { status, body } = await implementation.issuesUpdate(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -79428,449 +80824,777 @@ export function bootstrap( gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesCreateMilestoneParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesCreateMilestoneBodySchema = z.object({ - title: z.coerce.string(), - state: z.enum(["open", "closed"]).optional(), - description: z.coerce.string().optional(), - due_on: z.coerce.string().datetime({ offset: true }).optional(), - }) - - router.post( - "issuesCreateMilestone", - "/repos/:owner/:repo/milestones", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesCreateMilestoneParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesCreateMilestoneBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesCreateMilestone( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesGetMilestoneParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - milestone_number: z.coerce.number(), - }) - - router.get( - "issuesGetMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetMilestoneParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGetMilestone( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesUpdateMilestoneParamSchema = z.object({ + const issuesAddAssigneesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - milestone_number: z.coerce.number(), + issue_number: z.coerce.number(), }) - const issuesUpdateMilestoneBodySchema = z - .object({ - title: z.coerce.string().optional(), - state: z.enum(["open", "closed"]).optional(), - description: z.coerce.string().optional(), - due_on: z.coerce.string().datetime({ offset: true }).optional(), - }) + const issuesAddAssigneesBodySchema = z + .object({ assignees: z.array(z.coerce.string()).optional() }) .optional() - router.patch( - "issuesUpdateMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesUpdateMilestoneParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateMilestoneBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesUpdateMilestone( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesDeleteMilestoneParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - milestone_number: z.coerce.number(), - }) - - router.delete( - "issuesDeleteMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber", + router.post( + "issuesAddAssignees", + "/repos/:owner/:repo/issues/:issueNumber/assignees", async (ctx, next) => { const input = { - params: parseRequestInput(issuesDeleteMilestoneParamSchema, ctx.params), + params: parseRequestInput(issuesAddAssigneesParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(issuesAddAssigneesBodySchema, ctx.body), } - const { status, body } = await implementation.issuesDeleteMilestone( + const { status, body } = await implementation.issuesAddAssignees( input, ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const issuesListLabelsForMilestoneParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - milestone_number: z.coerce.number(), - }) - - const issuesListLabelsForMilestoneQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListLabelsForMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber/labels", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListLabelsForMilestoneParamSchema, - ctx.params - ), - query: parseRequestInput( - issuesListLabelsForMilestoneQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.issuesListLabelsForMilestone(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityListRepoNotificationsForAuthenticatedUserParamSchema = z.object( - { owner: z.coerce.string(), repo: z.coerce.string() } - ) - - const activityListRepoNotificationsForAuthenticatedUserQuerySchema = z.object( - { - all: z.coerce.boolean().optional(), - participating: z.coerce.boolean().optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - before: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - } - ) - - router.get( - "activityListRepoNotificationsForAuthenticatedUser", - "/repos/:owner/:repo/notifications", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListRepoNotificationsForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListRepoNotificationsForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListRepoNotificationsForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - repository: z.object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -79892,1314 +81616,1245 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ key: z.coerce.string(), name: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - subject: z.object({ - title: z.coerce.string(), - url: z.coerce.string(), - latest_comment_url: z.coerce.string(), - type: z.coerce.string(), - }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), - url: z.coerce.string(), - subscription_url: z.coerce.string(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityMarkRepoNotificationsAsReadParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const activityMarkRepoNotificationsAsReadBodySchema = z - .object({ - last_read_at: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional() - - router.put( - "activityMarkRepoNotificationsAsRead", - "/repos/:owner/:repo/notifications", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityMarkRepoNotificationsAsReadParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - activityMarkRepoNotificationsAsReadBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.activityMarkRepoNotificationsAsRead(input, ctx) - - if (status === 202) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetPagesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetPages", - "/repos/:owner/:repo/pages", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetPagesParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetPages(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - status: z.enum(["built", "building", "errored"]), - cname: z.coerce.string(), - protected_domain_state: z - .enum(["pending", "verified", "unverified"]) - .optional(), - pending_domain_unverified_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - custom_404: z.coerce.boolean(), - html_url: z.coerce.string().optional(), - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z - .object({ branch: z.coerce.string(), path: z.coerce.string() }) - .optional(), - public: z.coerce.boolean(), - https_certificate: z - .object({ - state: z.enum([ - "new", - "authorization_created", - "authorization_pending", - "authorized", - "authorization_revoked", - "issued", - "uploaded", - "approved", - "errored", - "bad_authz", - "destroy_pending", - "dns_changed", - ]), - description: z.coerce.string(), - domains: z.array(z.coerce.string()), - expires_at: z.coerce.string().optional(), - }) - .optional(), - https_enforced: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreatePagesSiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreatePagesSiteBodySchema = z.object({ - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z - .object({ - branch: z.coerce.string(), - path: z.enum(["/", "/docs"]).optional(), - }) - .optional(), - }) - - router.post( - "reposCreatePagesSite", - "/repos/:owner/:repo/pages", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreatePagesSiteParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreatePagesSiteBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreatePagesSite( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - status: z.enum(["built", "building", "errored"]), - cname: z.coerce.string(), - protected_domain_state: z - .enum(["pending", "verified", "unverified"]) - .optional(), - pending_domain_unverified_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - custom_404: z.coerce.boolean(), - html_url: z.coerce.string().optional(), - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z - .object({ branch: z.coerce.string(), path: z.coerce.string() }) - .optional(), - public: z.coerce.boolean(), - https_certificate: z - .object({ - state: z.enum([ - "new", - "authorization_created", - "authorization_pending", - "authorized", - "authorization_revoked", - "issued", - "uploaded", - "approved", - "errored", - "bad_authz", - "destroy_pending", - "dns_changed", - ]), - description: z.coerce.string(), - domains: z.array(z.coerce.string()), - expires_at: z.coerce.string().optional(), - }) - .optional(), - https_enforced: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUpdateInformationAboutPagesSiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposUpdateInformationAboutPagesSiteBodySchema = z.object({ - cname: z.coerce.string().optional(), - https_enforced: z.coerce.boolean().optional(), - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z.object({}).optional(), - }) - - router.put( - "reposUpdateInformationAboutPagesSite", - "/repos/:owner/:repo/pages", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateInformationAboutPagesSiteParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdateInformationAboutPagesSiteBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdateInformationAboutPagesSite(input, ctx) - - if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeletePagesSiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "reposDeletePagesSite", - "/repos/:owner/:repo/pages", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeletePagesSiteParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeletePagesSite( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposListPagesBuildsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListPagesBuildsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListPagesBuilds", - "/repos/:owner/:repo/pages/builds", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListPagesBuildsParamSchema, ctx.params), - query: parseRequestInput(reposListPagesBuildsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListPagesBuilds( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - commit: z.coerce.string(), - duration: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposRequestPagesBuildParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.post( - "reposRequestPagesBuild", - "/repos/:owner/:repo/pages/builds", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRequestPagesBuildParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposRequestPagesBuild( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ url: z.coerce.string(), status: z.coerce.string() }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetLatestPagesBuildParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetLatestPagesBuild", - "/repos/:owner/:repo/pages/builds/latest", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetLatestPagesBuildParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetLatestPagesBuild( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - commit: z.coerce.string(), - duration: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetPagesBuildParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - build_id: z.coerce.number(), - }) - - router.get( - "reposGetPagesBuild", - "/repos/:owner/:repo/pages/builds/:buildId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetPagesBuildParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetPagesBuild( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + .optional(), }), - commit: z.coerce.string(), - duration: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreatePagesDeploymentParamSchema = z.object({ + const issuesRemoveAssigneesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), }) - - const reposCreatePagesDeploymentBodySchema = z.object({ - artifact_url: z.coerce.string(), - environment: z.coerce.string().optional(), - pages_build_version: z.coerce.string(), - oidc_token: z.coerce.string(), + + const issuesRemoveAssigneesBodySchema = z.object({ + assignees: z.array(z.coerce.string()).optional(), }) - router.post( - "reposCreatePagesDeployment", - "/repos/:owner/:repo/pages/deployment", + router.delete( + "issuesRemoveAssignees", + "/repos/:owner/:repo/issues/:issueNumber/assignees", async (ctx, next) => { const input = { - params: parseRequestInput( - reposCreatePagesDeploymentParamSchema, - ctx.params - ), + params: parseRequestInput(issuesRemoveAssigneesParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposCreatePagesDeploymentBodySchema, ctx.body), + body: parseRequestInput(issuesRemoveAssigneesBodySchema, ctx.body), } - const { status, body } = await implementation.reposCreatePagesDeployment( + const { status, body } = await implementation.issuesRemoveAssignees( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - status_url: z.coerce.string(), - page_url: z.coerce.string(), - preview_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetPagesHealthCheckParamSchema = z.object({ + const issuesCheckUserCanBeAssignedToIssueParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), + assignee: z.coerce.string(), }) router.get( - "reposGetPagesHealthCheck", - "/repos/:owner/:repo/pages/health", + "issuesCheckUserCanBeAssignedToIssue", + "/repos/:owner/:repo/issues/:issueNumber/assignees/:assignee", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetPagesHealthCheckParamSchema, + issuesCheckUserCanBeAssignedToIssueParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetPagesHealthCheck( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - domain: z - .object({ - host: z.coerce.string().optional(), - uri: z.coerce.string().optional(), - nameservers: z.coerce.string().optional(), - dns_resolves: z.coerce.boolean().optional(), - is_proxied: z.coerce.boolean().optional(), - is_cloudflare_ip: z.coerce.boolean().optional(), - is_fastly_ip: z.coerce.boolean().optional(), - is_old_ip_address: z.coerce.boolean().optional(), - is_a_record: z.coerce.boolean().optional(), - has_cname_record: z.coerce.boolean().optional(), - has_mx_records_present: z.coerce.boolean().optional(), - is_valid_domain: z.coerce.boolean().optional(), - is_apex_domain: z.coerce.boolean().optional(), - should_be_a_record: z.coerce.boolean().optional(), - is_cname_to_github_user_domain: z.coerce.boolean().optional(), - is_cname_to_pages_dot_github_dot_com: z.coerce - .boolean() - .optional(), - is_cname_to_fastly: z.coerce.boolean().optional(), - is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), - is_non_github_pages_ip_present: z.coerce.boolean().optional(), - is_pages_domain: z.coerce.boolean().optional(), - is_served_by_pages: z.coerce.boolean().optional(), - is_valid: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - responds_to_https: z.coerce.boolean().optional(), - enforces_https: z.coerce.boolean().optional(), - https_error: z.coerce.string().optional(), - is_https_eligible: z.coerce.boolean().optional(), - caa_error: z.coerce.string().optional(), - }) - .optional(), - alt_domain: z - .object({ - host: z.coerce.string().optional(), - uri: z.coerce.string().optional(), - nameservers: z.coerce.string().optional(), - dns_resolves: z.coerce.boolean().optional(), - is_proxied: z.coerce.boolean().optional(), - is_cloudflare_ip: z.coerce.boolean().optional(), - is_fastly_ip: z.coerce.boolean().optional(), - is_old_ip_address: z.coerce.boolean().optional(), - is_a_record: z.coerce.boolean().optional(), - has_cname_record: z.coerce.boolean().optional(), - has_mx_records_present: z.coerce.boolean().optional(), - is_valid_domain: z.coerce.boolean().optional(), - is_apex_domain: z.coerce.boolean().optional(), - should_be_a_record: z.coerce.boolean().optional(), - is_cname_to_github_user_domain: z.coerce.boolean().optional(), - is_cname_to_pages_dot_github_dot_com: z.coerce - .boolean() - .optional(), - is_cname_to_fastly: z.coerce.boolean().optional(), - is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), - is_non_github_pages_ip_present: z.coerce.boolean().optional(), - is_pages_domain: z.coerce.boolean().optional(), - is_served_by_pages: z.coerce.boolean().optional(), - is_valid: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - responds_to_https: z.coerce.boolean().optional(), - enforces_https: z.coerce.boolean().optional(), - https_error: z.coerce.string().optional(), - is_https_eligible: z.coerce.boolean().optional(), - caa_error: z.coerce.string().optional(), - }) - .optional(), - }) - .parse(body) - } else if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.issuesCheckUserCanBeAssignedToIssue(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const projectsListForRepoParamSchema = z.object({ + const issuesListCommentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), }) - const projectsListForRepoQuerySchema = z.object({ - state: z.enum(["open", "closed", "all"]).optional(), + const issuesListCommentsQuerySchema = z.object({ + since: z.coerce.string().datetime({ offset: true }).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "projectsListForRepo", - "/repos/:owner/:repo/projects", + "issuesListComments", + "/repos/:owner/:repo/issues/:issueNumber/comments", async (ctx, next) => { const input = { - params: parseRequestInput(projectsListForRepoParamSchema, ctx.params), - query: parseRequestInput(projectsListForRepoQuerySchema, ctx.query), + params: parseRequestInput(issuesListCommentsParamSchema, ctx.params), + query: parseRequestInput(issuesListCommentsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.projectsListForRepo( + const { status, body } = await implementation.issuesListComments( input, ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const projectsCreateForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const projectsCreateForRepoBodySchema = z.object({ - name: z.coerce.string(), - body: z.coerce.string().optional(), - }) - - router.post( - "projectsCreateForRepo", - "/repos/:owner/:repo/projects", - async (ctx, next) => { - const input = { - params: parseRequestInput(projectsCreateForRepoParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(projectsCreateForRepoBodySchema, ctx.body), - } - - const { status, body } = await implementation.projectsCreateForRepo( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 410) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsListParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const pullsListQuerySchema = z.object({ - state: z.enum(["open", "closed", "all"]).optional(), - head: z.coerce.string().optional(), - base: z.coerce.string().optional(), - sort: z - .enum(["created", "updated", "popularity", "long-running"]) - .optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("pullsList", "/repos/:owner/:repo/pulls", async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListParamSchema, ctx.params), - query: parseRequestInput(pullsListQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.pullsList(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + const issuesCreateCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesCreateCommentBodySchema = z.object({ body: z.coerce.string() }) + + router.post( + "issuesCreateComment", + "/repos/:owner/:repo/issues/:issueNumber/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesCreateCommentParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesCreateCommentBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesCreateComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -81222,154 +82877,25 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -81391,346 +82917,742 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesListEventsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesListEventsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListEvents", + "/repos/:owner/:repo/issues/:issueNumber/events", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesListEventsParamSchema, ctx.params), + query: parseRequestInput(issuesListEventsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListEvents(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.object({}))], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesListLabelsOnIssueParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesListLabelsOnIssueQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListLabelsOnIssue", + "/repos/:owner/:repo/issues/:issueNumber/labels", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListLabelsOnIssueParamSchema, + ctx.params + ), + query: parseRequestInput(issuesListLabelsOnIssueQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListLabelsOnIssue( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesAddLabelsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesAddLabelsBodySchema = z.union([ + z.object({ labels: z.array(z.coerce.string()).optional() }), + z.array(z.coerce.string()), + z.object({ + labels: z.array(z.object({ name: z.coerce.string() })).optional(), + }), + z.array(z.object({ name: z.coerce.string() })), + z.coerce.string(), + ]) + + router.post( + "issuesAddLabels", + "/repos/:owner/:repo/issues/:issueNumber/labels", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesAddLabelsParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesAddLabelsBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesAddLabels(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesSetLabelsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesSetLabelsBodySchema = z.union([ + z.object({ labels: z.array(z.coerce.string()).optional() }), + z.array(z.coerce.string()), + z.object({ + labels: z.array(z.object({ name: z.coerce.string() })).optional(), + }), + z.array(z.object({ name: z.coerce.string() })), + z.coerce.string(), + ]) + + router.put( + "issuesSetLabels", + "/repos/:owner/:repo/issues/:issueNumber/labels", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesSetLabelsParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesSetLabelsBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesSetLabels(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - owner: z.object({ + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesRemoveAllLabelsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + router.delete( + "issuesRemoveAllLabels", + "/repos/:owner/:repo/issues/:issueNumber/labels", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesRemoveAllLabelsParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesRemoveAllLabels( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesRemoveLabelParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + name: z.coerce.string(), + }) + + router.delete( + "issuesRemoveLabel", + "/repos/:owner/:repo/issues/:issueNumber/labels/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesRemoveLabelParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesRemoveLabel( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + [ + "301", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesLockParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesLockBodySchema = z + .object({ + lock_reason: z + .enum(["off-topic", "too heated", "resolved", "spam"]) + .optional(), + }) + .optional() + + router.put( + "issuesLock", + "/repos/:owner/:repo/issues/:issueNumber/lock", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesLockParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesLockBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesLock(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesUnlockParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + router.delete( + "issuesUnlock", + "/repos/:owner/:repo/issues/:issueNumber/lock", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesUnlockParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesUnlock(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsListForIssueParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const reactionsListForIssueQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reactionsListForIssue", + "/repos/:owner/:repo/issues/:issueNumber/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput(reactionsListForIssueParamSchema, ctx.params), + query: parseRequestInput(reactionsListForIssueQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reactionsListForIssue( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -81753,517 +83675,91 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - draft: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() - }) - - const pullsCreateParamSchema = z.object({ + const reactionsCreateForIssueParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), }) - const pullsCreateBodySchema = z.object({ - title: z.coerce.string().optional(), - head: z.coerce.string(), - base: z.coerce.string(), - body: z.coerce.string().optional(), - maintainer_can_modify: z.coerce.boolean().optional(), - draft: z.coerce.boolean().optional(), - issue: z.coerce.number().optional(), + const reactionsCreateForIssueBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) - router.post("pullsCreate", "/repos/:owner/:repo/pulls", async (ctx, next) => { - const input = { - params: parseRequestInput(pullsCreateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsCreateBodySchema, ctx.body), - } + router.post( + "reactionsCreateForIssue", + "/repos/:owner/:repo/issues/:issueNumber/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsCreateForIssueParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reactionsCreateForIssueBodySchema, ctx.body), + } - const { status, body } = await implementation.pullsCreate(input, ctx) + const { status, body } = await implementation.reactionsCreateForIssue( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -82285,1680 +83781,918 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), + ], + [ + "201", + z.object({ id: z.coerce.number(), - is_template: z.coerce.boolean().optional(), node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), avatar_url: z.coerce.string(), - events_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), followers_url: z.coerce.string(), following_url: z.coerce.string(), gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), starred_url: z.coerce.string(), subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsDeleteForIssueParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + reaction_id: z.coerce.number(), + }) + + router.delete( + "reactionsDeleteForIssue", + "/repos/:owner/:repo/issues/:issueNumber/reactions/:reactionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsDeleteForIssueParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reactionsDeleteForIssue( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const issuesListEventsForTimelineParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesListEventsForTimelineQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListEventsForTimeline", + "/repos/:owner/:repo/issues/:issueNumber/timeline", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListEventsForTimelineParamSchema, + ctx.params + ), + query: parseRequestInput( + issuesListEventsForTimelineQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.issuesListEventsForTimeline( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.object({}))], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - merged: z.coerce.boolean(), - mergeable: z.coerce.boolean(), - rebaseable: z.coerce.boolean().optional(), - mergeable_state: z.coerce.string(), - merged_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments: z.coerce.number(), - review_comments: z.coerce.number(), - maintainer_can_modify: z.coerce.boolean(), - commits: z.coerce.number(), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changed_files: z.coerce.number(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reposListDeployKeysParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const pullsListReviewCommentsForRepoParamSchema = z.object({ + const reposListDeployKeysQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListDeployKeys", + "/repos/:owner/:repo/keys", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListDeployKeysParamSchema, ctx.params), + query: parseRequestInput(reposListDeployKeysQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListDeployKeys( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateDeployKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const pullsListReviewCommentsForRepoQuerySchema = z.object({ - sort: z.enum(["created", "updated", "created_at"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposCreateDeployKeyBodySchema = z.object({ + title: z.coerce.string().optional(), + key: z.coerce.string(), + read_only: z.coerce.boolean().optional(), }) - router.get( - "pullsListReviewCommentsForRepo", - "/repos/:owner/:repo/pulls/comments", + router.post( + "reposCreateDeployKey", + "/repos/:owner/:repo/keys", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsListReviewCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - pullsListReviewCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, + params: parseRequestInput(reposCreateDeployKeyParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateDeployKeyBodySchema, ctx.body), } - const { status, body } = - await implementation.pullsListReviewCommentsForRepo(input, ctx) + const { status, body } = await implementation.reposCreateDeployKey( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsGetReviewCommentParamSchema = z.object({ + const reposGetDeployKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + key_id: z.coerce.number(), }) router.get( - "pullsGetReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId", + "reposGetDeployKey", + "/repos/:owner/:repo/keys/:keyId", async (ctx, next) => { const input = { - params: parseRequestInput(pullsGetReviewCommentParamSchema, ctx.params), + params: parseRequestInput(reposGetDeployKeyParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.pullsGetReviewComment( + const { status, body } = await implementation.reposGetDeployKey( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + key: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteDeployKeyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + key_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteDeployKey", + "/repos/:owner/:repo/keys/:keyId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteDeployKeyParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposDeleteDeployKey( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const pullsUpdateReviewCommentParamSchema = z.object({ + const issuesListLabelsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - const pullsUpdateReviewCommentBodySchema = z.object({ - body: z.coerce.string(), + const issuesListLabelsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.patch( - "pullsUpdateReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId", + router.get( + "issuesListLabelsForRepo", + "/repos/:owner/:repo/labels", async (ctx, next) => { const input = { params: parseRequestInput( - pullsUpdateReviewCommentParamSchema, + issuesListLabelsForRepoParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput(pullsUpdateReviewCommentBodySchema, ctx.body), + query: parseRequestInput(issuesListLabelsForRepoQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.pullsUpdateReviewComment( + const { status, body } = await implementation.issuesListLabelsForRepo( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - .parse(body) - } - + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsDeleteReviewCommentParamSchema = z.object({ + const issuesCreateLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), }) - router.delete( - "pullsDeleteReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId", + const issuesCreateLabelBodySchema = z.object({ + name: z.coerce.string(), + color: z.coerce.string().optional(), + description: z.coerce.string().optional(), + }) + + router.post( + "issuesCreateLabel", + "/repos/:owner/:repo/labels", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsDeleteReviewCommentParamSchema, - ctx.params - ), + params: parseRequestInput(issuesCreateLabelParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(issuesCreateLabelBodySchema, ctx.body), } - const { status, body } = await implementation.pullsDeleteReviewComment( + const { status, body } = await implementation.issuesCreateLabel( input, ctx ) - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsListForPullRequestReviewCommentParamSchema = z.object({ + const issuesGetLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsListForPullRequestReviewCommentQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + name: z.coerce.string(), }) router.get( - "reactionsListForPullRequestReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId/reactions", + "issuesGetLabel", + "/repos/:owner/:repo/labels/:name", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsListForPullRequestReviewCommentParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForPullRequestReviewCommentQuerySchema, - ctx.query - ), + params: parseRequestInput(issuesGetLabelParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = - await implementation.reactionsListForPullRequestReviewComment( - input, - ctx - ) + const { status, body } = await implementation.issuesGetLabel(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesUpdateLabelParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + name: z.coerce.string(), + }) + + const issuesUpdateLabelBodySchema = z + .object({ + new_name: z.coerce.string().optional(), + color: z.coerce.string().optional(), + description: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "issuesUpdateLabel", + "/repos/:owner/:repo/labels/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesUpdateLabelParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesUpdateLabelBodySchema, ctx.body), } + const { status, body } = await implementation.issuesUpdateLabel( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsCreateForPullRequestReviewCommentParamSchema = z.object({ + const issuesDeleteLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsCreateForPullRequestReviewCommentBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), + name: z.coerce.string(), }) - router.post( - "reactionsCreateForPullRequestReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId/reactions", + router.delete( + "issuesDeleteLabel", + "/repos/:owner/:repo/labels/:name", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsCreateForPullRequestReviewCommentParamSchema, - ctx.params - ), + params: parseRequestInput(issuesDeleteLabelParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - reactionsCreateForPullRequestReviewCommentBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = - await implementation.reactionsCreateForPullRequestReviewComment( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + const { status, body } = await implementation.issuesDeleteLabel( + input, + ctx + ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reactionsDeleteForPullRequestCommentParamSchema = z.object({ + const reposListLanguagesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), - reaction_id: z.coerce.number(), }) - router.delete( - "reactionsDeleteForPullRequestComment", - "/repos/:owner/:repo/pulls/comments/:commentId/reactions/:reactionId", + router.get( + "reposListLanguages", + "/repos/:owner/:repo/languages", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsDeleteForPullRequestCommentParamSchema, - ctx.params - ), + params: parseRequestInput(reposListLanguagesParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.reactionsDeleteForPullRequestComment(input, ctx) + const { status, body } = await implementation.reposListLanguages( + input, + ctx + ) + ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const pullsGetParamSchema = z.object({ + const reposEnableLfsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - router.get( - "pullsGet", - "/repos/:owner/:repo/pulls/:pullNumber", + router.put( + "reposEnableLfsForRepo", + "/repos/:owner/:repo/lfs", async (ctx, next) => { const input = { - params: parseRequestInput(pullsGetParamSchema, ctx.params), + params: parseRequestInput(reposEnableLfsForRepoParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.pullsGet(input, ctx) + const { status, body } = await implementation.reposEnableLfsForRepo( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + ["403", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDisableLfsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "reposDisableLfsForRepo", + "/repos/:owner/:repo/lfs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDisableLfsForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDisableLfsForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const licensesGetForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "licensesGetForRepo", + "/repos/:owner/:repo/license", + async (ctx, next) => { + const input = { + params: parseRequestInput(licensesGetForRepoParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.licensesGetForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + path: z.coerce.string(), sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), + size: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + git_url: z.coerce.string(), + download_url: z.coerce.string(), + type: z.coerce.string(), + content: z.coerce.string(), + encoding: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), + html_url: z.coerce.string().optional(), }), }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposMergeUpstreamParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposMergeUpstreamBodySchema = z.object({ branch: z.coerce.string() }) + + router.post( + "reposMergeUpstream", + "/repos/:owner/:repo/merge-upstream", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposMergeUpstreamParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposMergeUpstreamBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposMergeUpstream( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + message: z.coerce.string().optional(), + merge_type: z.enum(["merge", "fast-forward", "none"]).optional(), + base_branch: z.coerce.string().optional(), }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + ], + ["409", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposMergeParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposMergeBodySchema = z.object({ + base: z.coerce.string(), + head: z.coerce.string(), + commit_message: z.coerce.string().optional(), + }) + + router.post("reposMerge", "/repos/:owner/:repo/merges", async (ctx, next) => { + const input = { + params: parseRequestInput(reposMergeParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposMergeBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposMerge(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), }), - draft: z.coerce.boolean().optional(), - merged: z.coerce.boolean(), - mergeable: z.coerce.boolean(), - rebaseable: z.coerce.boolean().optional(), - mergeable_state: z.coerce.string(), - merged_by: z.object({ + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -83981,131 +84715,236 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - comments: z.coerce.number(), - review_comments: z.coerce.number(), - maintainer_can_modify: z.coerce.boolean(), - commits: z.coerce.number(), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changed_files: z.coerce.number(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + ["204", z.void()], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + ["404", z.void()], + ["409", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const issuesListMilestonesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesListMilestonesQuerySchema = z.object({ + state: z.enum(["open", "closed", "all"]).optional(), + sort: z.enum(["due_on", "completeness"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListMilestones", + "/repos/:owner/:repo/milestones", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesListMilestonesParamSchema, ctx.params), + query: parseRequestInput(issuesListMilestonesQuerySchema, ctx.query), + body: undefined, } + const { status, body } = await implementation.issuesListMilestones( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsUpdateParamSchema = z.object({ + const issuesCreateMilestoneParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsUpdateBodySchema = z - .object({ - title: z.coerce.string().optional(), - body: z.coerce.string().optional(), - state: z.enum(["open", "closed"]).optional(), - base: z.coerce.string().optional(), - maintainer_can_modify: z.coerce.boolean().optional(), - }) - .optional() + const issuesCreateMilestoneBodySchema = z.object({ + title: z.coerce.string(), + state: z.enum(["open", "closed"]).optional(), + description: z.coerce.string().optional(), + due_on: z.coerce.string().datetime({ offset: true }).optional(), + }) - router.patch( - "pullsUpdate", - "/repos/:owner/:repo/pulls/:pullNumber", + router.post( + "issuesCreateMilestone", + "/repos/:owner/:repo/milestones", async (ctx, next) => { const input = { - params: parseRequestInput(pullsUpdateParamSchema, ctx.params), + params: parseRequestInput(issuesCreateMilestoneParamSchema, ctx.params), query: undefined, - body: parseRequestInput(pullsUpdateBodySchema, ctx.body), + body: parseRequestInput(issuesCreateMilestoneBodySchema, ctx.body), } - const { status, body } = await implementation.pullsUpdate(input, ctx) + const { status, body } = await implementation.issuesCreateMilestone( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ url: z.coerce.string(), html_url: z.coerce.string(), labels_url: z.coerce.string(), @@ -84145,420 +84984,175 @@ export function bootstrap( closed_at: z.coerce.string().datetime({ offset: true }), due_on: z.coerce.string().datetime({ offset: true }), }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), + ) + .optional(), }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesGetMilestoneParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + milestone_number: z.coerce.number(), + }) + + router.get( + "issuesGetMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesGetMilestoneParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesGetMilestone( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), avatar_url: z.coerce.string(), - events_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), followers_url: z.coerce.string(), following_url: z.coerce.string(), gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), starred_url: z.coerce.string(), subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), type: z.coerce.string(), - url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesUpdateMilestoneParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + milestone_number: z.coerce.number(), + }) + + const issuesUpdateMilestoneBodySchema = z + .object({ + title: z.coerce.string().optional(), + state: z.enum(["open", "closed"]).optional(), + description: z.coerce.string().optional(), + due_on: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional() + + router.patch( + "issuesUpdateMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesUpdateMilestoneParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesUpdateMilestoneBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesUpdateMilestone( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -84581,473 +85175,888 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), }), - draft: z.coerce.boolean().optional(), - merged: z.coerce.boolean(), - mergeable: z.coerce.boolean(), - rebaseable: z.coerce.boolean().optional(), - mergeable_state: z.coerce.string(), - merged_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesDeleteMilestoneParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + milestone_number: z.coerce.number(), + }) + + router.delete( + "issuesDeleteMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesDeleteMilestoneParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesDeleteMilestone( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - comments: z.coerce.number(), - review_comments: z.coerce.number(), - maintainer_can_modify: z.coerce.boolean(), - commits: z.coerce.number(), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changed_files: z.coerce.number(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesListLabelsForMilestoneParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + milestone_number: z.coerce.number(), + }) + + const issuesListLabelsForMilestoneQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListLabelsForMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber/labels", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListLabelsForMilestoneParamSchema, + ctx.params + ), + query: parseRequestInput( + issuesListLabelsForMilestoneQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.issuesListLabelsForMilestone(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activityListRepoNotificationsForAuthenticatedUserParamSchema = z.object( + { owner: z.coerce.string(), repo: z.coerce.string() } + ) + + const activityListRepoNotificationsForAuthenticatedUserQuerySchema = z.object( + { + all: z.coerce.boolean().optional(), + participating: z.coerce.boolean().optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + before: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + } + ) + + router.get( + "activityListRepoNotificationsForAuthenticatedUser", + "/repos/:owner/:repo/notifications", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListRepoNotificationsForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListRepoNotificationsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListRepoNotificationsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activityMarkRepoNotificationsAsReadParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const activityMarkRepoNotificationsAsReadBodySchema = z + .object({ + last_read_at: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional() + + router.put( + "activityMarkRepoNotificationsAsRead", + "/repos/:owner/:repo/notifications", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityMarkRepoNotificationsAsReadParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + activityMarkRepoNotificationsAsReadBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.activityMarkRepoNotificationsAsRead(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "202", + z.object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }), + ], + ["205", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetPagesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetPages", + "/repos/:owner/:repo/pages", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetPagesParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposGetPages(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + status: z.enum(["built", "building", "errored"]), + cname: z.coerce.string(), + protected_domain_state: z + .enum(["pending", "verified", "unverified"]) + .optional(), + pending_domain_unverified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + custom_404: z.coerce.boolean(), + html_url: z.coerce.string().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ branch: z.coerce.string(), path: z.coerce.string() }) + .optional(), + public: z.coerce.boolean(), + https_certificate: z + .object({ + state: z.enum([ + "new", + "authorization_created", + "authorization_pending", + "authorized", + "authorization_revoked", + "issued", + "uploaded", + "approved", + "errored", + "bad_authz", + "destroy_pending", + "dns_changed", + ]), + description: z.coerce.string(), + domains: z.array(z.coerce.string()), + expires_at: z.coerce.string().optional(), + }) + .optional(), + https_enforced: z.coerce.boolean().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesCreateWithPrForAuthenticatedUserParamSchema = z.object({ + const reposCreatePagesSiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const codespacesCreateWithPrForAuthenticatedUserBodySchema = z.object({ - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - multi_repo_permissions_opt_out: z.coerce.boolean().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - display_name: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), + const reposCreatePagesSiteBodySchema = z.object({ + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ + branch: z.coerce.string(), + path: z.enum(["/", "/docs"]).optional(), + }) + .optional(), }) router.post( - "codespacesCreateWithPrForAuthenticatedUser", - "/repos/:owner/:repo/pulls/:pullNumber/codespaces", + "reposCreatePagesSite", + "/repos/:owner/:repo/pages", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesCreateWithPrForAuthenticatedUserParamSchema, - ctx.params - ), + params: parseRequestInput(reposCreatePagesSiteParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - codespacesCreateWithPrForAuthenticatedUserBodySchema, - ctx.body - ), + body: parseRequestInput(reposCreatePagesSiteBodySchema, ctx.body), } - const { status, body } = - await implementation.codespacesCreateWithPrForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.reposCreatePagesSite( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) + status: z.enum(["built", "building", "errored"]), + cname: z.coerce.string(), + protected_domain_state: z + .enum(["pending", "verified", "unverified"]) .optional(), - updated_at: z.coerce + pending_domain_unverified_at: z.coerce .string() .datetime({ offset: true }) .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) + custom_404: z.coerce.boolean(), + html_url: z.coerce.string().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ branch: z.coerce.string(), path: z.coerce.string() }) .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + public: z.coerce.boolean(), + https_certificate: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + state: z.enum([ + "new", + "authorization_created", + "authorization_pending", + "authorized", + "authorization_revoked", + "issued", + "uploaded", + "approved", + "errored", + "bad_authz", + "destroy_pending", + "dns_changed", + ]), + description: z.coerce.string(), + domains: z.array(z.coerce.string()), + expires_at: z.coerce.string().optional(), }) .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) + https_enforced: z.coerce.boolean().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateInformationAboutPagesSiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposUpdateInformationAboutPagesSiteBodySchema = z.object({ + cname: z.coerce.string().optional(), + https_enforced: z.coerce.boolean().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z.object({}).optional(), + }) + + router.put( + "reposUpdateInformationAboutPagesSite", + "/repos/:owner/:repo/pages", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdateInformationAboutPagesSiteParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposUpdateInformationAboutPagesSiteBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposUpdateInformationAboutPagesSite(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 202) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeletePagesSiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "reposDeletePagesSite", + "/repos/:owner/:repo/pages", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeletePagesSiteParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeletePagesSite( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListPagesBuildsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListPagesBuildsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListPagesBuilds", + "/repos/:owner/:repo/pages/builds", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListPagesBuildsParamSchema, ctx.params), + query: parseRequestInput(reposListPagesBuildsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListPagesBuilds( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRequestPagesBuildParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.post( + "reposRequestPagesBuild", + "/repos/:owner/:repo/pages/builds", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRequestPagesBuildParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposRequestPagesBuild( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ url: z.coerce.string(), status: z.coerce.string() }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetLatestPagesBuildParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetLatestPagesBuild", + "/repos/:owner/:repo/pages/builds/latest", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetLatestPagesBuildParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetLatestPagesBuild( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -85070,303 +86079,50 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsListReviewCommentsParamSchema = z.object({ + const reposGetPagesBuildParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsListReviewCommentsQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + build_id: z.coerce.number(), }) router.get( - "pullsListReviewComments", - "/repos/:owner/:repo/pulls/:pullNumber/comments", + "reposGetPagesBuild", + "/repos/:owner/:repo/pages/builds/:buildId", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsListReviewCommentsParamSchema, - ctx.params - ), - query: parseRequestInput(pullsListReviewCommentsQuerySchema, ctx.query), + params: parseRequestInput(reposGetPagesBuildParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.pullsListReviewComments( + const { status, body } = await implementation.reposGetPagesBuild( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -85389,844 +86145,1490 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - body: z.coerce.string(), + commit: z.coerce.string(), + duration: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsCreateReviewCommentParamSchema = z.object({ + const reposCreatePagesDeploymentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsCreateReviewCommentBodySchema = z.object({ - body: z.coerce.string(), - commit_id: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number(), - start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT", "side"]).optional(), - in_reply_to: z.coerce.number().optional(), + const reposCreatePagesDeploymentBodySchema = z.object({ + artifact_url: z.coerce.string(), + environment: z.coerce.string().optional(), + pages_build_version: z.coerce.string(), + oidc_token: z.coerce.string(), }) router.post( - "pullsCreateReviewComment", - "/repos/:owner/:repo/pulls/:pullNumber/comments", + "reposCreatePagesDeployment", + "/repos/:owner/:repo/pages/deployment", async (ctx, next) => { const input = { params: parseRequestInput( - pullsCreateReviewCommentParamSchema, + reposCreatePagesDeploymentParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(pullsCreateReviewCommentBodySchema, ctx.body), + body: parseRequestInput(reposCreatePagesDeploymentBodySchema, ctx.body), } - const { status, body } = await implementation.pullsCreateReviewComment( + const { status, body } = await implementation.reposCreatePagesDeployment( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + status_url: z.coerce.string(), + page_url: z.coerce.string(), + preview_url: z.coerce.string().optional(), }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), + ], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetPagesHealthCheckParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetPagesHealthCheck", + "/repos/:owner/:repo/pages/health", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetPagesHealthCheckParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetPagesHealthCheck( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + domain: z + .object({ + host: z.coerce.string().optional(), + uri: z.coerce.string().optional(), + nameservers: z.coerce.string().optional(), + dns_resolves: z.coerce.boolean().optional(), + is_proxied: z.coerce.boolean().optional(), + is_cloudflare_ip: z.coerce.boolean().optional(), + is_fastly_ip: z.coerce.boolean().optional(), + is_old_ip_address: z.coerce.boolean().optional(), + is_a_record: z.coerce.boolean().optional(), + has_cname_record: z.coerce.boolean().optional(), + has_mx_records_present: z.coerce.boolean().optional(), + is_valid_domain: z.coerce.boolean().optional(), + is_apex_domain: z.coerce.boolean().optional(), + should_be_a_record: z.coerce.boolean().optional(), + is_cname_to_github_user_domain: z.coerce.boolean().optional(), + is_cname_to_pages_dot_github_dot_com: z.coerce + .boolean() + .optional(), + is_cname_to_fastly: z.coerce.boolean().optional(), + is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), + is_non_github_pages_ip_present: z.coerce.boolean().optional(), + is_pages_domain: z.coerce.boolean().optional(), + is_served_by_pages: z.coerce.boolean().optional(), + is_valid: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + responds_to_https: z.coerce.boolean().optional(), + enforces_https: z.coerce.boolean().optional(), + https_error: z.coerce.string().optional(), + is_https_eligible: z.coerce.boolean().optional(), + caa_error: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) + .optional(), + alt_domain: z + .object({ + host: z.coerce.string().optional(), + uri: z.coerce.string().optional(), + nameservers: z.coerce.string().optional(), + dns_resolves: z.coerce.boolean().optional(), + is_proxied: z.coerce.boolean().optional(), + is_cloudflare_ip: z.coerce.boolean().optional(), + is_fastly_ip: z.coerce.boolean().optional(), + is_old_ip_address: z.coerce.boolean().optional(), + is_a_record: z.coerce.boolean().optional(), + has_cname_record: z.coerce.boolean().optional(), + has_mx_records_present: z.coerce.boolean().optional(), + is_valid_domain: z.coerce.boolean().optional(), + is_apex_domain: z.coerce.boolean().optional(), + should_be_a_record: z.coerce.boolean().optional(), + is_cname_to_github_user_domain: z.coerce.boolean().optional(), + is_cname_to_pages_dot_github_dot_com: z.coerce + .boolean() + .optional(), + is_cname_to_fastly: z.coerce.boolean().optional(), + is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), + is_non_github_pages_ip_present: z.coerce.boolean().optional(), + is_pages_domain: z.coerce.boolean().optional(), + is_served_by_pages: z.coerce.boolean().optional(), + is_valid: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + responds_to_https: z.coerce.boolean().optional(), + enforces_https: z.coerce.boolean().optional(), + https_error: z.coerce.string().optional(), + is_https_eligible: z.coerce.boolean().optional(), + caa_error: z.coerce.string().optional(), + }) + .optional(), + }), + ], + ["202", z.object({})], + ["400", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["422", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const projectsListForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const projectsListForRepoQuerySchema = z.object({ + state: z.enum(["open", "closed", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "projectsListForRepo", + "/repos/:owner/:repo/projects", + async (ctx, next) => { + const input = { + params: parseRequestInput(projectsListForRepoParamSchema, ctx.params), + query: parseRequestInput(projectsListForRepoQuerySchema, ctx.query), + body: undefined, } + const { status, body } = await implementation.projectsListForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsCreateReplyForReviewCommentParamSchema = z.object({ + const projectsCreateForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), - comment_id: z.coerce.number(), }) - const pullsCreateReplyForReviewCommentBodySchema = z.object({ - body: z.coerce.string(), + const projectsCreateForRepoBodySchema = z.object({ + name: z.coerce.string(), + body: z.coerce.string().optional(), }) router.post( - "pullsCreateReplyForReviewComment", - "/repos/:owner/:repo/pulls/:pullNumber/comments/:commentId/replies", + "projectsCreateForRepo", + "/repos/:owner/:repo/projects", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsCreateReplyForReviewCommentParamSchema, - ctx.params - ), + params: parseRequestInput(projectsCreateForRepoParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - pullsCreateReplyForReviewCommentBodySchema, - ctx.body - ), + body: parseRequestInput(projectsCreateForRepoBodySchema, ctx.body), } - const { status, body } = - await implementation.pullsCreateReplyForReviewComment(input, ctx) + const { status, body } = await implementation.projectsCreateForRepo( + input, + ctx + ) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "410", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsListCommitsParamSchema = z.object({ + const pullsListParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsListCommitsQuerySchema = z.object({ + const pullsListQuerySchema = z.object({ + state: z.enum(["open", "closed", "all"]).optional(), + head: z.coerce.string().optional(), + base: z.coerce.string().optional(), + sort: z + .enum(["created", "updated", "popularity", "long-running"]) + .optional(), + direction: z.enum(["asc", "desc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "pullsListCommits", - "/repos/:owner/:repo/pulls/:pullNumber/commits", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListCommitsParamSchema, ctx.params), - query: parseRequestInput(pullsListCommitsQuerySchema, ctx.query), - body: undefined, - } + router.get("pullsList", "/repos/:owner/:repo/pulls", async (ctx, next) => { + const input = { + params: parseRequestInput(pullsListParamSchema, ctx.params), + query: parseRequestInput(pullsListQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = await implementation.pullsListCommits(input, ctx) + const { status, body } = await implementation.pullsList(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ url: z.coerce.string(), - sha: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), comments_url: z.coerce.string(), - commit: z.object({ + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - author: z.object({ + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - date: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }), - committer: z.object({ + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsListFilesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsListFilesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "pullsListFiles", - "/repos/:owner/:repo/pulls/:pullNumber/files", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListFilesParamSchema, ctx.params), - query: parseRequestInput(pullsListFilesQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.pullsListFiles(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsCheckIfMergedParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - router.get( - "pullsCheckIfMerged", - "/repos/:owner/:repo/pulls/:pullNumber/merge", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsCheckIfMergedParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.pullsCheckIfMerged( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const pullsMergeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsMergeBodySchema = z - .object({ - commit_title: z.coerce.string().optional(), - commit_message: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - merge_method: z.enum(["merge", "squash", "rebase"]).optional(), - }) - .optional() - - router.put( - "pullsMerge", - "/repos/:owner/:repo/pulls/:pullNumber/merge", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsMergeParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsMergeBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsMerge(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - sha: z.coerce.string(), - merged: z.coerce.boolean(), - message: z.coerce.string(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 405) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsListRequestedReviewersParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - router.get( - "pullsListRequestedReviewers", - "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", - async (ctx, next) => { - const input = { - params: parseRequestInput( - pullsListRequestedReviewersParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.pullsListRequestedReviewers( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - users: z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - }) - ), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ), + ], + ["304", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const pullsRequestReviewersParamSchema = z.object({ + const pullsCreateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsRequestReviewersBodySchema = z - .object({ - reviewers: z.array(z.coerce.string()).optional(), - team_reviewers: z.array(z.coerce.string()).optional(), - }) - .optional() + const pullsCreateBodySchema = z.object({ + title: z.coerce.string().optional(), + head: z.coerce.string(), + base: z.coerce.string(), + body: z.coerce.string().optional(), + maintainer_can_modify: z.coerce.boolean().optional(), + draft: z.coerce.boolean().optional(), + issue: z.coerce.number().optional(), + }) - router.post( - "pullsRequestReviewers", - "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsRequestReviewersParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsRequestReviewersBodySchema, ctx.body), - } + router.post("pullsCreate", "/repos/:owner/:repo/pulls", async (ctx, next) => { + const input = { + params: parseRequestInput(pullsCreateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsCreateBodySchema, ctx.body), + } - const { status, body } = await implementation.pullsRequestReviewers( - input, - ctx - ) + const { status, body } = await implementation.pullsCreate(input, ctx) - if (status === 201) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), @@ -86240,7 +87642,7 @@ export function bootstrap( comments_url: z.coerce.string(), statuses_url: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), + state: z.enum(["open", "closed"]), locked: z.coerce.boolean(), title: z.coerce.string(), user: z.object({ @@ -86406,38 +87808,16 @@ export function bootstrap( z.object({ id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), - slug: z.coerce.string(), description: z.coerce.string(), - privacy: z.coerce.string().optional(), permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - members_url: z.coerce.string(), repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), }) ) .optional(), @@ -86445,54 +87825,467 @@ export function bootstrap( label: z.coerce.string(), ref: z.coerce.string(), repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), license: z.object({ key: z.coerce.string(), name: z.coerce.string(), url: z.coerce.string(), spdx_id: z.coerce.string(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), permissions: z .object({ admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), }) .optional(), - owner: z.object({ + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const pullsListReviewCommentsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const pullsListReviewCommentsForRepoQuerySchema = z.object({ + sort: z.enum(["created", "updated", "created_at"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "pullsListReviewCommentsForRepo", + "/repos/:owner/:repo/pulls/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsListReviewCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + pullsListReviewCommentsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.pullsListReviewCommentsForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86515,235 +88308,224 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + body: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsGetReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + router.get( + "pullsGetReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsGetReviewCommentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsGetReviewComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }), - sha: z.coerce.string(), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsUpdateReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const pullsUpdateReviewCommentBodySchema = z.object({ + body: z.coerce.string(), + }) + + router.patch( + "pullsUpdateReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsUpdateReviewCommentParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(pullsUpdateReviewCommentBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsUpdateReviewComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -86767,59 +88549,156 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsDeleteReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + router.delete( + "pullsDeleteReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsDeleteReviewCommentParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsDeleteReviewComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsListForPullRequestReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const reactionsListForPullRequestReviewCommentQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reactionsListForPullRequestReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsListForPullRequestReviewCommentParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForPullRequestReviewCommentQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reactionsListForPullRequestReviewComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86842,236 +88721,346 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsCreateForPullRequestReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const reactionsCreateForPullRequestReviewCommentBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + }) + + router.post( + "reactionsCreateForPullRequestReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsCreateForPullRequestReviewCommentParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reactionsCreateForPullRequestReviewCommentBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reactionsCreateForPullRequestReviewComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsDeleteForPullRequestCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + reaction_id: z.coerce.number(), + }) + + router.delete( + "reactionsDeleteForPullRequestComment", + "/repos/:owner/:repo/pulls/comments/:commentId/reactions/:reactionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsDeleteForPullRequestCommentParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reactionsDeleteForPullRequestComment(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const pullsGetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + router.get( + "pullsGet", + "/repos/:owner/:repo/pulls/:pullNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsGetParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsGet(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }), - sha: z.coerce.string(), - user: z.object({ + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87094,29 +89083,423 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87139,124 +89522,100 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), }), - draft: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsRemoveRequestedReviewersParamSchema = z.object({ + const pullsUpdateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), pull_number: z.coerce.number(), }) - const pullsRemoveRequestedReviewersBodySchema = z.object({ - reviewers: z.array(z.coerce.string()), - team_reviewers: z.array(z.coerce.string()).optional(), - }) + const pullsUpdateBodySchema = z + .object({ + title: z.coerce.string().optional(), + body: z.coerce.string().optional(), + state: z.enum(["open", "closed"]).optional(), + base: z.coerce.string().optional(), + maintainer_can_modify: z.coerce.boolean().optional(), + }) + .optional() - router.delete( - "pullsRemoveRequestedReviewers", - "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", + router.patch( + "pullsUpdate", + "/repos/:owner/:repo/pulls/:pullNumber", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsRemoveRequestedReviewersParamSchema, - ctx.params - ), + params: parseRequestInput(pullsUpdateParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - pullsRemoveRequestedReviewersBodySchema, - ctx.body - ), + body: parseRequestInput(pullsUpdateBodySchema, ctx.body), } - const { status, body } = - await implementation.pullsRemoveRequestedReviewers(input, ctx) + const { status, body } = await implementation.pullsUpdate(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), number: z.coerce.number(), state: z.enum(["open", "closed"]), + locked: z.coerce.boolean(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87279,45 +89638,29 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( + body: z.coerce.string(), + labels: z.array( z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87339,128 +89682,428 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), followers_url: z.coerce.string(), following_url: z.coerce.string(), gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), received_events_url: z.coerce.string(), - type: z.coerce.string(), + repos_url: z.coerce.string(), site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), permissions: z .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), }) .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87483,236 +90126,160 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateWithPrForAuthenticatedUserParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const codespacesCreateWithPrForAuthenticatedUserBodySchema = z.object({ + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + multi_repo_permissions_opt_out: z.coerce.boolean().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + display_name: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + }) + + router.post( + "codespacesCreateWithPrForAuthenticatedUser", + "/repos/:owner/:repo/pulls/:pullNumber/codespaces", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCreateWithPrForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesCreateWithPrForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateWithPrForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }), - sha: z.coerce.string(), - user: z.object({ + billable_owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87735,58 +90302,11 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -87832,7 +90352,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -87844,7 +90364,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -87852,194 +90372,179 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z + secret_scanning: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }), - sha: z.coerce.string(), - user: z.object({ + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "202", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -88062,29 +90567,7 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + billable_owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -88107,575 +90590,449 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsListReviewsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsListReviewsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "pullsListReviews", - "/repos/:owner/:repo/pulls/:pullNumber/reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListReviewsParamSchema, ctx.params), - query: parseRequestInput(pullsListReviewsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.pullsListReviews(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), }), - submitted_at: z.coerce + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce .string() .datetime({ offset: true }) .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsCreateReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsCreateReviewBodySchema = z - .object({ - commit_id: z.coerce.string().optional(), - body: z.coerce.string().optional(), - event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]).optional(), - comments: z - .array( - z.object({ - path: z.coerce.string(), - position: z.coerce.number().optional(), - body: z.coerce.string(), - line: z.coerce.number().optional(), - side: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - start_side: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional() - - router.post( - "pullsCreateReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsCreateReviewParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsCreateReviewBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsCreateReview( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + last_known_stop_notice: z.coerce.string().optional(), }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsGetReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - router.get( - "pullsGetReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsGetReviewParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.pullsGetReview(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsUpdateReviewParamSchema = z.object({ + const pullsListReviewCommentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), pull_number: z.coerce.number(), - review_id: z.coerce.number(), }) - const pullsUpdateReviewBodySchema = z.object({ body: z.coerce.string() }) - - router.put( - "pullsUpdateReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsUpdateReviewParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsUpdateReviewBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsUpdateReview( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsDeletePendingReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), + const pullsListReviewCommentsQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.delete( - "pullsDeletePendingReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", + router.get( + "pullsListReviewComments", + "/repos/:owner/:repo/pulls/:pullNumber/comments", async (ctx, next) => { const input = { params: parseRequestInput( - pullsDeletePendingReviewParamSchema, + pullsListReviewCommentsParamSchema, ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.pullsDeletePendingReview( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) + ), + query: parseRequestInput(pullsListReviewCommentsQuerySchema, ctx.query), + body: undefined, } + const { status, body } = await implementation.pullsListReviewComments( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const pullsListCommentsForReviewParamSchema = z.object({ + const pullsCreateReviewCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), pull_number: z.coerce.number(), - review_id: z.coerce.number(), }) - const pullsListCommentsForReviewQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const pullsCreateReviewCommentBodySchema = z.object({ + body: z.coerce.string(), + commit_id: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number(), + start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT", "side"]).optional(), + in_reply_to: z.coerce.number().optional(), }) - router.get( - "pullsListCommentsForReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/comments", + router.post( + "pullsCreateReviewComment", + "/repos/:owner/:repo/pulls/:pullNumber/comments", async (ctx, next) => { const input = { params: parseRequestInput( - pullsListCommentsForReviewParamSchema, + pullsCreateReviewCommentParamSchema, ctx.params ), - query: parseRequestInput( - pullsListCommentsForReviewQuerySchema, - ctx.query - ), - body: undefined, + query: undefined, + body: parseRequestInput(pullsCreateReviewCommentBodySchema, ctx.body), } - const { status, body } = await implementation.pullsListCommentsForReview( + const { status, body } = await implementation.pullsCreateReviewComment( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ url: z.coerce.string(), pull_request_review_id: z.coerce.number(), @@ -88731,8 +91088,12 @@ export function bootstrap( html: z.object({ href: z.coerce.string() }), pull_request: z.object({ href: z.coerce.string() }), }), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), reactions: z .object({ url: z.coerce.string(), @@ -88747,545 +91108,97 @@ export function bootstrap( rocket: z.coerce.number(), }) .optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsDismissReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - const pullsDismissReviewBodySchema = z.object({ - message: z.coerce.string(), - event: z.enum(["DISMISS"]).optional(), - }) - - router.put( - "pullsDismissReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/dismissals", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsDismissReviewParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsDismissReviewBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsDismissReview( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsSubmitReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - const pullsSubmitReviewBodySchema = z.object({ - body: z.coerce.string().optional(), - event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), - }) - - router.post( - "pullsSubmitReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/events", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsSubmitReviewParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsSubmitReviewBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsSubmitReview( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const pullsUpdateBranchParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsUpdateBranchBodySchema = z - .object({ expected_head_sha: z.coerce.string().optional() }) - .optional() - - router.put( - "pullsUpdateBranch", - "/repos/:owner/:repo/pulls/:pullNumber/update-branch", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsUpdateBranchParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsUpdateBranchBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsUpdateBranch( - input, - ctx - ) - - if (status === 202) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetReadmeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposGetReadmeQuerySchema = z.object({ - ref: z.coerce.string().optional(), - }) - - router.get( - "reposGetReadme", - "/repos/:owner/:repo/readme", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetReadmeParamSchema, ctx.params), - query: parseRequestInput(reposGetReadmeQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposGetReadme(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - type: z.enum(["file"]), - encoding: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), }), - target: z.coerce.string().optional(), - submodule_git_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetReadmeInDirectoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - dir: z.coerce.string(), - }) - - const reposGetReadmeInDirectoryQuerySchema = z.object({ - ref: z.coerce.string().optional(), - }) - - router.get( - "reposGetReadmeInDirectory", - "/repos/:owner/:repo/readme/:dir", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetReadmeInDirectoryParamSchema, - ctx.params - ), - query: parseRequestInput( - reposGetReadmeInDirectoryQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.reposGetReadmeInDirectory( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - type: z.enum(["file"]), - encoding: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - target: z.coerce.string().optional(), - submodule_git_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListReleasesParamSchema = z.object({ + const pullsCreateReplyForReviewCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), + comment_id: z.coerce.number(), }) - const reposListReleasesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const pullsCreateReplyForReviewCommentBodySchema = z.object({ + body: z.coerce.string(), }) - router.get( - "reposListReleases", - "/repos/:owner/:repo/releases", + router.post( + "pullsCreateReplyForReviewComment", + "/repos/:owner/:repo/pulls/:pullNumber/comments/:commentId/replies", async (ctx, next) => { const input = { - params: parseRequestInput(reposListReleasesParamSchema, ctx.params), - query: parseRequestInput(reposListReleasesQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput( + pullsCreateReplyForReviewCommentParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + pullsCreateReplyForReviewCommentBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposListReleases( - input, - ctx - ) + const { status, body } = + await implementation.pullsCreateReplyForReviewComment(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), id: z.coerce.number(), node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -89308,49 +91221,32 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), reactions: z .object({ url: z.coerce.string(), @@ -89365,114 +91261,112 @@ export function bootstrap( rocket: z.coerce.number(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateReleaseParamSchema = z.object({ + const pullsListCommitsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - const reposCreateReleaseBodySchema = z.object({ - tag_name: z.coerce.string(), - target_commitish: z.coerce.string().optional(), - name: z.coerce.string().optional(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean().optional(), - prerelease: z.coerce.boolean().optional(), - discussion_category_name: z.coerce.string().optional(), - generate_release_notes: z.coerce.boolean().optional(), - make_latest: z.enum(["true", "false", "legacy"]).optional(), + const pullsListCommitsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "reposCreateRelease", - "/repos/:owner/:repo/releases", + router.get( + "pullsListCommits", + "/repos/:owner/:repo/pulls/:pullNumber/commits", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreateReleaseParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateReleaseBodySchema, ctx.body), + params: parseRequestInput(pullsListCommitsParamSchema, ctx.params), + query: parseRequestInput(pullsListCommitsQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposCreateRelease( - input, - ctx - ) + const { status, body } = await implementation.pullsListCommits(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), + sha: z.coerce.string(), node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -89495,379 +91389,941 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), }) ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetReleaseAssetParamSchema = z.object({ + const pullsListFilesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - asset_id: z.coerce.number(), + pull_number: z.coerce.number(), }) - router.get( - "reposGetReleaseAsset", - "/repos/:owner/:repo/releases/assets/:assetId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetReleaseAssetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetReleaseAsset( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUpdateReleaseAssetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - asset_id: z.coerce.number(), + const pullsListFilesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - const reposUpdateReleaseAssetBodySchema = z - .object({ - name: z.coerce.string().optional(), - label: z.coerce.string().optional(), - state: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "reposUpdateReleaseAsset", - "/repos/:owner/:repo/releases/assets/:assetId", + router.get( + "pullsListFiles", + "/repos/:owner/:repo/pulls/:pullNumber/files", async (ctx, next) => { const input = { - params: parseRequestInput( - reposUpdateReleaseAssetParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposUpdateReleaseAssetBodySchema, ctx.body), + params: parseRequestInput(pullsListFilesParamSchema, ctx.params), + query: parseRequestInput(pullsListFilesQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.reposUpdateReleaseAsset( - input, - ctx - ) + const { status, body } = await implementation.pullsListFiles(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), }), - }) - .parse(body) - } - + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDeleteReleaseAssetParamSchema = z.object({ + const pullsCheckIfMergedParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - asset_id: z.coerce.number(), + pull_number: z.coerce.number(), }) - router.delete( - "reposDeleteReleaseAsset", - "/repos/:owner/:repo/releases/assets/:assetId", + router.get( + "pullsCheckIfMerged", + "/repos/:owner/:repo/pulls/:pullNumber/merge", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDeleteReleaseAssetParamSchema, - ctx.params - ), + params: parseRequestInput(pullsCheckIfMergedParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposDeleteReleaseAsset( + const { status, body } = await implementation.pullsCheckIfMerged( input, ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGenerateReleaseNotesParamSchema = z.object({ + const pullsMergeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - const reposGenerateReleaseNotesBodySchema = z.object({ - tag_name: z.coerce.string(), - target_commitish: z.coerce.string().optional(), - previous_tag_name: z.coerce.string().optional(), - configuration_file_path: z.coerce.string().optional(), + const pullsMergeBodySchema = z + .object({ + commit_title: z.coerce.string().optional(), + commit_message: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + merge_method: z.enum(["merge", "squash", "rebase"]).optional(), + }) + .optional() + + router.put( + "pullsMerge", + "/repos/:owner/:repo/pulls/:pullNumber/merge", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsMergeParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsMergeBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsMerge(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + sha: z.coerce.string(), + merged: z.coerce.boolean(), + message: z.coerce.string(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "405", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListRequestedReviewersParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - router.post( - "reposGenerateReleaseNotes", - "/repos/:owner/:repo/releases/generate-notes", + router.get( + "pullsListRequestedReviewers", + "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", async (ctx, next) => { const input = { params: parseRequestInput( - reposGenerateReleaseNotesParamSchema, + pullsListRequestedReviewersParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(reposGenerateReleaseNotesBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reposGenerateReleaseNotes( + const { status, body } = await implementation.pullsListRequestedReviewers( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ name: z.coerce.string(), body: z.coerce.string() }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetLatestReleaseParamSchema = z.object({ + const pullsRequestReviewersParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - router.get( - "reposGetLatestRelease", - "/repos/:owner/:repo/releases/latest", + const pullsRequestReviewersBodySchema = z + .object({ + reviewers: z.array(z.coerce.string()).optional(), + team_reviewers: z.array(z.coerce.string()).optional(), + }) + .optional() + + router.post( + "pullsRequestReviewers", + "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetLatestReleaseParamSchema, ctx.params), + params: parseRequestInput(pullsRequestReviewersParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(pullsRequestReviewersBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetLatestRelease( + const { status, body } = await implementation.pullsRequestReviewers( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - browser_download_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -89890,248 +92346,311 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetReleaseByTagParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - tag: z.coerce.string(), - }) - - router.get( - "reposGetReleaseByTag", - "/repos/:owner/:repo/releases/tags/:tag", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetReleaseByTagParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetReleaseByTag( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), + }), + base: z.object({ label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetReleaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - router.get( - "reposGetRelease", - "/repos/:owner/:repo/releases/:releaseId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetReleaseParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetRelease(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -90154,135 +92673,29 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUpdateReleaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - const reposUpdateReleaseBodySchema = z - .object({ - tag_name: z.coerce.string().optional(), - target_commitish: z.coerce.string().optional(), - name: z.coerce.string().optional(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean().optional(), - prerelease: z.coerce.boolean().optional(), - make_latest: z.enum(["true", "false", "legacy"]).optional(), - discussion_category_name: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "reposUpdateRelease", - "/repos/:owner/:repo/releases/:releaseId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateReleaseParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateReleaseBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdateRelease( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -90297,272 +92710,90 @@ export function bootstrap( gists_url: z.coerce.string(), starred_url: z.coerce.string(), subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteReleaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteRelease", - "/repos/:owner/:repo/releases/:releaseId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteReleaseParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteRelease( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const reposListReleaseAssetsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - const reposListReleaseAssetsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListReleaseAssets", - "/repos/:owner/:repo/releases/:releaseId/assets", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListReleaseAssetsParamSchema, - ctx.params - ), - query: parseRequestInput(reposListReleaseAssetsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListReleaseAssets( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposUploadReleaseAssetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - const reposUploadReleaseAssetQuerySchema = z.object({ - name: z.coerce.string(), - label: z.coerce.string().optional(), - }) - - const reposUploadReleaseAssetBodySchema = z.coerce.string().optional() - - router.post( - "reposUploadReleaseAsset", - "/repos/:owner/:repo/releases/:releaseId/assets", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUploadReleaseAssetParamSchema, - ctx.params - ), - query: parseRequestInput(reposUploadReleaseAssetQuerySchema, ctx.query), - body: parseRequestInput(reposUploadReleaseAssetBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUploadReleaseAsset( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), }), - }) - .parse(body) - } - + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reactionsListForReleaseParamSchema = z.object({ + const pullsRemoveRequestedReviewersParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + pull_number: z.coerce.number(), }) - const reactionsListForReleaseQuerySchema = z.object({ - content: z - .enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const pullsRemoveRequestedReviewersBodySchema = z.object({ + reviewers: z.array(z.coerce.string()), + team_reviewers: z.array(z.coerce.string()).optional(), }) - router.get( - "reactionsListForRelease", - "/repos/:owner/:repo/releases/:releaseId/reactions", + router.delete( + "pullsRemoveRequestedReviewers", + "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsListForReleaseParamSchema, + pullsRemoveRequestedReviewersParamSchema, ctx.params ), - query: parseRequestInput(reactionsListForReleaseQuerySchema, ctx.query), - body: undefined, + query: undefined, + body: parseRequestInput( + pullsRemoveRequestedReviewersBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reactionsListForRelease( - input, - ctx - ) + const { status, body } = + await implementation.pullsRemoveRequestedReviewers(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -90586,274 +92817,485 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsCreateForReleaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - const reactionsCreateForReleaseBodySchema = z.object({ - content: z.enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]), - }) - - router.post( - "reactionsCreateForRelease", - "/repos/:owner/:repo/releases/:releaseId/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForReleaseParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reactionsCreateForReleaseBodySchema, ctx.body), - } - - const { status, body } = await implementation.reactionsCreateForRelease( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + body: z.coerce.string(), + labels: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsDeleteForReleaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - release_id: z.coerce.number(), - reaction_id: z.coerce.number(), - }) - - router.delete( - "reactionsDeleteForRelease", - "/repos/:owner/:repo/releases/:releaseId/reactions/:reactionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsDeleteForReleaseParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reactionsDeleteForRelease( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const secretScanningListAlertsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const secretScanningListAlertsForRepoQuerySchema = z.object({ - state: z.enum(["open", "resolved"]).optional(), - secret_type: z.coerce.string().optional(), - resolution: z.coerce.string().optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - }) - - router.get( - "secretScanningListAlertsForRepo", - "/repos/:owner/:repo/secret-scanning/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningListAlertsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListAlertsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.secretScanningListAlertsForRepo(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) .optional(), - resolved_by: z - .object({ + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -90875,15 +93317,312 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -90905,1849 +93644,1420 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const secretScanningGetAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - router.get( - "secretScanningGetAlert", - "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningGetAlertParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.secretScanningGetAlert( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - number: z.coerce.number().optional(), - created_at: z.coerce.string().datetime({ offset: true }).optional(), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const secretScanningUpdateAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const secretScanningUpdateAlertBodySchema = z.object({ - state: z.enum(["open", "resolved"]), - resolution: z - .enum(["null", "false_positive", "wont_fix", "revoked", "used_in_tests"]) - .optional(), - resolution_comment: z.coerce.string().optional(), - }) - - router.patch( - "secretScanningUpdateAlert", - "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningUpdateAlertParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(secretScanningUpdateAlertBodySchema, ctx.body), - } - - const { status, body } = await implementation.secretScanningUpdateAlert( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - number: z.coerce.number().optional(), - created_at: z.coerce.string().datetime({ offset: true }).optional(), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const secretScanningListLocationsForAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const secretScanningListLocationsForAlertQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - }) - - router.get( - "secretScanningListLocationsForAlert", - "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber/locations", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningListLocationsForAlertParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListLocationsForAlertQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.secretScanningListLocationsForAlert(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - type: z.enum([ - "commit", - "issue_title", - "issue_body", - "issue_comment", - ]), - details: z.union([ - z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number(), - end_column: z.coerce.number(), - blob_sha: z.coerce.string(), - blob_url: z.coerce.string(), - commit_sha: z.coerce.string(), - commit_url: z.coerce.string(), }), - z.object({ issue_title_url: z.coerce.string() }), - z.object({ issue_body_url: z.coerce.string() }), - z.object({ issue_comment_url: z.coerce.string() }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", ]), - }) - ) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityListStargazersForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const activityListStargazersForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListStargazersForRepo", - "/repos/:owner/:repo/stargazers", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListStargazersForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListStargazersForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListStargazersForRepo(input, ctx) - - if (status === 200) { - ctx.body = z.object({}).parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetCodeFrequencyStatsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetCodeFrequencyStats", - "/repos/:owner/:repo/stats/code_frequency", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCodeFrequencyStatsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetCodeFrequencyStats( - input, - ctx - ) - - if (status === 200) { - ctx.body = z.array(z.array(z.coerce.number())).parse(body) - } else if (status === 202) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetCommitActivityStatsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetCommitActivityStats", - "/repos/:owner/:repo/stats/commit_activity", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCommitActivityStatsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetCommitActivityStats( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - days: z.array(z.coerce.number()), - total: z.coerce.number(), - week: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 202) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetContributorsStatsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetContributorsStats", - "/repos/:owner/:repo/stats/contributors", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetContributorsStatsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetContributorsStats( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), }), - total: z.coerce.number(), - weeks: z.array( - z.object({ - w: z.coerce.number().optional(), - a: z.coerce.number().optional(), - d: z.coerce.number().optional(), - c: z.coerce.number().optional(), - }) - ), - }) - ) - .parse(body) - } else if (status === 202) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetParticipationStatsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetParticipationStats", - "/repos/:owner/:repo/stats/participation", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetParticipationStatsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetParticipationStats( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - all: z.array(z.coerce.number()), - owner: z.array(z.coerce.number()), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposGetPunchCardStatsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetPunchCardStats", - "/repos/:owner/:repo/stats/punch_card", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetPunchCardStatsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetPunchCardStats( - input, - ctx - ) - - if (status === 200) { - ctx.body = z.array(z.array(z.coerce.number())).parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateCommitStatusParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - sha: z.coerce.string(), - }) - - const reposCreateCommitStatusBodySchema = z.object({ - state: z.enum(["error", "failure", "pending", "success"]), - target_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - context: z.coerce.string().optional(), - }) - - router.post( - "reposCreateCommitStatus", - "/repos/:owner/:repo/statuses/:sha", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateCommitStatusParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateCommitStatusBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateCommitStatus( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - url: z.coerce.string(), - avatar_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.coerce.string(), - description: z.coerce.string(), - target_url: z.coerce.string(), - context: z.coerce.string(), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityListWatchersForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const activityListWatchersForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListWatchersForRepo", - "/repos/:owner/:repo/subscribers", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListWatchersForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListWatchersForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.activityListWatchersForRepo( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityGetRepoSubscriptionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "activityGetRepoSubscription", - "/repos/:owner/:repo/subscription", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityGetRepoSubscriptionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.activityGetRepoSubscription( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - repository_url: z.coerce.string(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activitySetRepoSubscriptionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const activitySetRepoSubscriptionBodySchema = z - .object({ - subscribed: z.coerce.boolean().optional(), - ignored: z.coerce.boolean().optional(), - }) - .optional() - - router.put( - "activitySetRepoSubscription", - "/repos/:owner/:repo/subscription", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activitySetRepoSubscriptionParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - activitySetRepoSubscriptionBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.activitySetRepoSubscription( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - repository_url: z.coerce.string(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityDeleteRepoSubscriptionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "activityDeleteRepoSubscription", - "/repos/:owner/:repo/subscription", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityDeleteRepoSubscriptionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.activityDeleteRepoSubscription(input, ctx) - - ctx.status = status - return next() - } - ) - - const reposListTagsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListTagsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("reposListTags", "/repos/:owner/:repo/tags", async (ctx, next) => { - const input = { - params: parseRequestInput(reposListTagsParamSchema, ctx.params), - query: parseRequestInput(reposListTagsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListTags(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), + draft: z.coerce.boolean().optional(), }), - zipball_url: z.coerce.string(), - tarball_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - }) - - const reposListTagProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposListTagProtection", - "/repos/:owner/:repo/tags/protection", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListTagProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposListTagProtection( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - pattern: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateTagProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateTagProtectionBodySchema = z.object({ - pattern: z.coerce.string(), - }) - - router.post( - "reposCreateTagProtection", - "/repos/:owner/:repo/tags/protection", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateTagProtectionParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateTagProtectionBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateTagProtection( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - pattern: z.coerce.string(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposDeleteTagProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - tag_protection_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteTagProtection", - "/repos/:owner/:repo/tags/protection/:tagProtectionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteTagProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteTagProtection( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDownloadTarballArchiveParamSchema = z.object({ + const pullsListReviewsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsListReviewsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposDownloadTarballArchive", - "/repos/:owner/:repo/tarball/:ref", + "pullsListReviews", + "/repos/:owner/:repo/pulls/:pullNumber/reviews", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDownloadTarballArchiveParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(pullsListReviewsParamSchema, ctx.params), + query: parseRequestInput(pullsListReviewsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposDownloadTarballArchive( - input, - ctx - ) + const { status, body } = await implementation.pullsListReviews(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListTeamsParamSchema = z.object({ + const pullsCreateReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - const reposListTeamsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const pullsCreateReviewBodySchema = z + .object({ + commit_id: z.coerce.string().optional(), + body: z.coerce.string().optional(), + event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]).optional(), + comments: z + .array( + z.object({ + path: z.coerce.string(), + position: z.coerce.number().optional(), + body: z.coerce.string(), + line: z.coerce.number().optional(), + side: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + start_side: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional() - router.get( - "reposListTeams", - "/repos/:owner/:repo/teams", + router.post( + "pullsCreateReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews", async (ctx, next) => { const input = { - params: parseRequestInput(reposListTeamsParamSchema, ctx.params), - query: parseRequestInput(reposListTeamsQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(pullsCreateReviewParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsCreateReviewBodySchema, ctx.body), } - const { status, body } = await implementation.reposListTeams(input, ctx) + const { status, body } = await implementation.pullsCreateReview( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - }) - ) - .parse(body) - } - + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetAllTopicsParamSchema = z.object({ + const pullsGetReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const reposGetAllTopicsQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), }) router.get( - "reposGetAllTopics", - "/repos/:owner/:repo/topics", + "pullsGetReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetAllTopicsParamSchema, ctx.params), - query: parseRequestInput(reposGetAllTopicsQuerySchema, ctx.query), + params: parseRequestInput(pullsGetReviewParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetAllTopics( - input, - ctx - ) - - if (status === 200) { - ctx.body = z.object({ names: z.array(z.coerce.string()) }).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.pullsGetReview(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposReplaceAllTopicsParamSchema = z.object({ + const pullsUpdateReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), }) - const reposReplaceAllTopicsBodySchema = z.object({ - names: z.array(z.coerce.string()), - }) + const pullsUpdateReviewBodySchema = z.object({ body: z.coerce.string() }) router.put( - "reposReplaceAllTopics", - "/repos/:owner/:repo/topics", + "pullsUpdateReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", async (ctx, next) => { const input = { - params: parseRequestInput(reposReplaceAllTopicsParamSchema, ctx.params), + params: parseRequestInput(pullsUpdateReviewParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposReplaceAllTopicsBodySchema, ctx.body), + body: parseRequestInput(pullsUpdateReviewBodySchema, ctx.body), } - const { status, body } = await implementation.reposReplaceAllTopics( + const { status, body } = await implementation.pullsUpdateReview( input, ctx ) - if (status === 200) { - ctx.body = z.object({ names: z.array(z.coerce.string()) }).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetClonesParamSchema = z.object({ + const pullsDeletePendingReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), }) - const reposGetClonesQuerySchema = z.object({ - per: z.enum(["", "day", "week"]).optional(), - }) - - router.get( - "reposGetClones", - "/repos/:owner/:repo/traffic/clones", + router.delete( + "pullsDeletePendingReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetClonesParamSchema, ctx.params), - query: parseRequestInput(reposGetClonesQuerySchema, ctx.query), + params: parseRequestInput( + pullsDeletePendingReviewParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetClones(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - count: z.coerce.number(), - uniques: z.coerce.number(), - clones: z.array( - z.object({ - timestamp: z.coerce.string().datetime({ offset: true }), - uniques: z.coerce.number(), - count: z.coerce.number(), - }) - ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.pullsDeletePendingReview( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetTopPathsParamSchema = z.object({ + const pullsListCommentsForReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + const pullsListCommentsForReviewQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetTopPaths", - "/repos/:owner/:repo/traffic/popular/paths", + "pullsListCommentsForReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/comments", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetTopPathsParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + pullsListCommentsForReviewParamSchema, + ctx.params + ), + query: parseRequestInput( + pullsListCommentsForReviewQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposGetTopPaths(input, ctx) + const { status, body } = await implementation.pullsListCommentsForReview( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + }) + ), + ], + [ + "404", z.object({ - path: z.coerce.string(), - title: z.coerce.string(), - count: z.coerce.number(), - uniques: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetTopReferrersParamSchema = z.object({ + const pullsDismissReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), }) - router.get( - "reposGetTopReferrers", - "/repos/:owner/:repo/traffic/popular/referrers", + const pullsDismissReviewBodySchema = z.object({ + message: z.coerce.string(), + event: z.enum(["DISMISS"]).optional(), + }) + + router.put( + "pullsDismissReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/dismissals", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetTopReferrersParamSchema, ctx.params), + params: parseRequestInput(pullsDismissReviewParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(pullsDismissReviewBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetTopReferrers( + const { status, body } = await implementation.pullsDismissReview( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - referrer: z.coerce.string(), - count: z.coerce.number(), - uniques: z.coerce.number(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGetViewsParamSchema = z.object({ + const pullsSubmitReviewParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), }) - const reposGetViewsQuerySchema = z.object({ - per: z.enum(["", "day", "week"]).optional(), + const pullsSubmitReviewBodySchema = z.object({ + body: z.coerce.string().optional(), + event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), }) - router.get( - "reposGetViews", - "/repos/:owner/:repo/traffic/views", + router.post( + "pullsSubmitReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/events", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetViewsParamSchema, ctx.params), - query: parseRequestInput(reposGetViewsQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(pullsSubmitReviewParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsSubmitReviewBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetViews(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - count: z.coerce.number(), - uniques: z.coerce.number(), - views: z.array( - z.object({ - timestamp: z.coerce.string().datetime({ offset: true }), - uniques: z.coerce.number(), - count: z.coerce.number(), - }) - ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.pullsSubmitReview( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposTransferParamSchema = z.object({ + const pullsUpdateBranchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - const reposTransferBodySchema = z.object({ - new_owner: z.coerce.string(), - new_name: z.coerce.string().optional(), - team_ids: z.array(z.coerce.number()).optional(), - }) + const pullsUpdateBranchBodySchema = z + .object({ expected_head_sha: z.coerce.string().optional() }) + .optional() - router.post( - "reposTransfer", - "/repos/:owner/:repo/transfer", + router.put( + "pullsUpdateBranch", + "/repos/:owner/:repo/pulls/:pullNumber/update-branch", async (ctx, next) => { const input = { - params: parseRequestInput(reposTransferParamSchema, ctx.params), + params: parseRequestInput(pullsUpdateBranchParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposTransferBodySchema, ctx.body), + body: parseRequestInput(pullsUpdateBranchBodySchema, ctx.body), } - const { status, body } = await implementation.reposTransfer(input, ctx) + const { status, body } = await implementation.pullsUpdateBranch( + input, + ctx + ) - if (status === 202) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "202", + z.object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }).optional(), - created_at: z.coerce.string().datetime({ offset: true }).optional(), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - }) - .optional(), - }) - .parse(body) - } - + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCheckVulnerabilityAlertsParamSchema = z.object({ + const reposGetReadmeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) + const reposGetReadmeQuerySchema = z.object({ + ref: z.coerce.string().optional(), + }) + router.get( - "reposCheckVulnerabilityAlerts", - "/repos/:owner/:repo/vulnerability-alerts", + "reposGetReadme", + "/repos/:owner/:repo/readme", async (ctx, next) => { const input = { - params: parseRequestInput( - reposCheckVulnerabilityAlertsParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(reposGetReadmeParamSchema, ctx.params), + query: parseRequestInput(reposGetReadmeQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposCheckVulnerabilityAlerts(input, ctx) + const { status, body } = await implementation.reposGetReadme(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposEnableVulnerabilityAlertsParamSchema = z.object({ + const reposGetReadmeInDirectoryParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + dir: z.coerce.string(), }) - router.put( - "reposEnableVulnerabilityAlerts", - "/repos/:owner/:repo/vulnerability-alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposEnableVulnerabilityAlertsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposEnableVulnerabilityAlerts(input, ctx) - - ctx.status = status - return next() - } - ) - - const reposDisableVulnerabilityAlertsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), + const reposGetReadmeInDirectoryQuerySchema = z.object({ + ref: z.coerce.string().optional(), }) - router.delete( - "reposDisableVulnerabilityAlerts", - "/repos/:owner/:repo/vulnerability-alerts", + router.get( + "reposGetReadmeInDirectory", + "/repos/:owner/:repo/readme/:dir", async (ctx, next) => { const input = { params: parseRequestInput( - reposDisableVulnerabilityAlertsParamSchema, + reposGetReadmeInDirectoryParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + reposGetReadmeInDirectoryQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = - await implementation.reposDisableVulnerabilityAlerts(input, ctx) + const { status, body } = await implementation.reposGetReadmeInDirectory( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDownloadZipballArchiveParamSchema = z.object({ + const reposListReleasesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), + }) + + const reposListReleasesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposDownloadZipballArchive", - "/repos/:owner/:repo/zipball/:ref", + "reposListReleases", + "/repos/:owner/:repo/releases", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDownloadZipballArchiveParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(reposListReleasesParamSchema, ctx.params), + query: parseRequestInput(reposListReleasesQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposDownloadZipballArchive( + const { status, body } = await implementation.reposListReleases( input, ctx ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateUsingTemplateParamSchema = z.object({ - template_owner: z.coerce.string(), - template_repo: z.coerce.string(), + const reposCreateReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const reposCreateUsingTemplateBodySchema = z.object({ - owner: z.coerce.string().optional(), - name: z.coerce.string(), - description: z.coerce.string().optional(), - include_all_branches: z.coerce.boolean().optional(), - private: z.coerce.boolean().optional(), + const reposCreateReleaseBodySchema = z.object({ + tag_name: z.coerce.string(), + target_commitish: z.coerce.string().optional(), + name: z.coerce.string().optional(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean().optional(), + prerelease: z.coerce.boolean().optional(), + discussion_category_name: z.coerce.string().optional(), + generate_release_notes: z.coerce.boolean().optional(), + make_latest: z.enum(["true", "false", "legacy"]).optional(), }) router.post( - "reposCreateUsingTemplate", - "/repos/:templateOwner/:templateRepo/generate", + "reposCreateRelease", + "/repos/:owner/:repo/releases", async (ctx, next) => { const input = { - params: parseRequestInput( - reposCreateUsingTemplateParamSchema, - ctx.params - ), + params: parseRequestInput(reposCreateReleaseParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposCreateUsingTemplateBodySchema, ctx.body), + body: parseRequestInput(reposCreateReleaseBodySchema, ctx.body), } - const { status, body } = await implementation.reposCreateUsingTemplate( + const { status, body } = await implementation.reposCreateRelease( input, ctx ) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ url: z.coerce.string(), - spdx_id: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -92769,892 +95079,1153 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .parse(body) - } - + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListPublicQuerySchema = z.object({ - since: z.coerce.number().optional(), + const reposGetReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + asset_id: z.coerce.number(), }) - router.get("reposListPublic", "/repositories", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(reposListPublicQuerySchema, ctx.query), - body: undefined, - } + router.get( + "reposGetReleaseAsset", + "/repos/:owner/:repo/releases/assets/:assetId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetReleaseAssetParamSchema, ctx.params), + query: undefined, + body: undefined, + } - const { status, body } = await implementation.reposListPublic(input, ctx) + const { status, body } = await implementation.reposGetReleaseAsset( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }).optional(), - created_at: z.coerce.string().datetime({ offset: true }).optional(), - updated_at: z.coerce.string().datetime({ offset: true }).optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + ], + ["302", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reposUpdateReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + asset_id: z.coerce.number(), }) - const actionsListEnvironmentSecretsParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - }) + const reposUpdateReleaseAssetBodySchema = z + .object({ + name: z.coerce.string().optional(), + label: z.coerce.string().optional(), + state: z.coerce.string().optional(), + }) + .optional() - const actionsListEnvironmentSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + router.patch( + "reposUpdateReleaseAsset", + "/repos/:owner/:repo/releases/assets/:assetId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdateReleaseAssetParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposUpdateReleaseAssetBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdateReleaseAsset( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + asset_id: z.coerce.number(), }) - router.get( - "actionsListEnvironmentSecrets", - "/repositories/:repositoryId/environments/:environmentName/secrets", + router.delete( + "reposDeleteReleaseAsset", + "/repos/:owner/:repo/releases/assets/:assetId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListEnvironmentSecretsParamSchema, + reposDeleteReleaseAssetParamSchema, ctx.params ), - query: parseRequestInput( - actionsListEnvironmentSecretsQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsListEnvironmentSecrets(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }) - .parse(body) - } + const { status, body } = await implementation.reposDeleteReleaseAsset( + input, + ctx + ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsGetEnvironmentPublicKeyParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), + const reposGenerateReleaseNotesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.get( - "actionsGetEnvironmentPublicKey", - "/repositories/:repositoryId/environments/:environmentName/secrets/public-key", + const reposGenerateReleaseNotesBodySchema = z.object({ + tag_name: z.coerce.string(), + target_commitish: z.coerce.string().optional(), + previous_tag_name: z.coerce.string().optional(), + configuration_file_path: z.coerce.string().optional(), + }) + + router.post( + "reposGenerateReleaseNotes", + "/repos/:owner/:repo/releases/generate-notes", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetEnvironmentPublicKeyParamSchema, + reposGenerateReleaseNotesParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(reposGenerateReleaseNotesBodySchema, ctx.body), } - const { status, body } = - await implementation.actionsGetEnvironmentPublicKey(input, ctx) + const { status, body } = await implementation.reposGenerateReleaseNotes( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ name: z.coerce.string(), body: z.coerce.string() }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetLatestReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetLatestRelease", + "/repos/:owner/:repo/releases/latest", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetLatestReleaseParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.reposGetLatestRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetEnvironmentSecretParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - secret_name: z.coerce.string(), + const reposGetReleaseByTagParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + tag: z.coerce.string(), }) router.get( - "actionsGetEnvironmentSecret", - "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + "reposGetReleaseByTag", + "/repos/:owner/:repo/releases/tags/:tag", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsGetEnvironmentSecretParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetReleaseByTagParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetEnvironmentSecret( + const { status, body } = await implementation.reposGetReleaseByTag( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const actionsCreateOrUpdateEnvironmentSecretParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const actionsCreateOrUpdateEnvironmentSecretBodySchema = z.object({ - encrypted_value: z.coerce.string(), - key_id: z.coerce.string(), - }) - - router.put( - "actionsCreateOrUpdateEnvironmentSecret", - "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsCreateOrUpdateEnvironmentSecretParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsCreateOrUpdateEnvironmentSecretBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsCreateOrUpdateEnvironmentSecret(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDeleteEnvironmentSecretParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - secret_name: z.coerce.string(), + const reposGetReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - router.delete( - "actionsDeleteEnvironmentSecret", - "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + router.get( + "reposGetRelease", + "/repos/:owner/:repo/releases/:releaseId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsDeleteEnvironmentSecretParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetReleaseParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsDeleteEnvironmentSecret(input, ctx) + const { status, body } = await implementation.reposGetRelease(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListEnvironmentVariablesParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), + const reposUpdateReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - const actionsListEnvironmentVariablesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const reposUpdateReleaseBodySchema = z + .object({ + tag_name: z.coerce.string().optional(), + target_commitish: z.coerce.string().optional(), + name: z.coerce.string().optional(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean().optional(), + prerelease: z.coerce.boolean().optional(), + make_latest: z.enum(["true", "false", "legacy"]).optional(), + discussion_category_name: z.coerce.string().optional(), + }) + .optional() - router.get( - "actionsListEnvironmentVariables", - "/repositories/:repositoryId/environments/:environmentName/variables", + router.patch( + "reposUpdateRelease", + "/repos/:owner/:repo/releases/:releaseId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsListEnvironmentVariablesParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListEnvironmentVariablesQuerySchema, - ctx.query - ), - body: undefined, + params: parseRequestInput(reposUpdateReleaseParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateReleaseBodySchema, ctx.body), } - const { status, body } = - await implementation.actionsListEnvironmentVariables(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }) - .parse(body) - } + const { status, body } = await implementation.reposUpdateRelease( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() - } - ) - - const actionsCreateEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - }) + } + ) - const actionsCreateEnvironmentVariableBodySchema = z.object({ - name: z.coerce.string(), - value: z.coerce.string(), + const reposDeleteReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - router.post( - "actionsCreateEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables", + router.delete( + "reposDeleteRelease", + "/repos/:owner/:repo/releases/:releaseId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsCreateEnvironmentVariableParamSchema, - ctx.params - ), + params: parseRequestInput(reposDeleteReleaseParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - actionsCreateEnvironmentVariableBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = - await implementation.actionsCreateEnvironmentVariable(input, ctx) - - if (status === 201) { - ctx.body = z.object({}).parse(body) - } + const { status, body } = await implementation.reposDeleteRelease( + input, + ctx + ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsGetEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), + const reposListReleaseAssetsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + }) + + const reposListReleaseAssetsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "actionsGetEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", + "reposListReleaseAssets", + "/repos/:owner/:repo/releases/:releaseId/assets", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetEnvironmentVariableParamSchema, + reposListReleaseAssetsParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput(reposListReleaseAssetsQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.actionsGetEnvironmentVariable(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } + const { status, body } = await implementation.reposListReleaseAssets( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsUpdateEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), + const reposUploadReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - const actionsUpdateEnvironmentVariableBodySchema = z.object({ - name: z.coerce.string().optional(), - value: z.coerce.string().optional(), + const reposUploadReleaseAssetQuerySchema = z.object({ + name: z.coerce.string(), + label: z.coerce.string().optional(), }) - router.patch( - "actionsUpdateEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", + const reposUploadReleaseAssetBodySchema = z.coerce.string().optional() + + router.post( + "reposUploadReleaseAsset", + "/repos/:owner/:repo/releases/:releaseId/assets", async (ctx, next) => { const input = { params: parseRequestInput( - actionsUpdateEnvironmentVariableParamSchema, + reposUploadReleaseAssetParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - actionsUpdateEnvironmentVariableBodySchema, - ctx.body - ), + query: parseRequestInput(reposUploadReleaseAssetQuerySchema, ctx.query), + body: parseRequestInput(reposUploadReleaseAssetBodySchema, ctx.body), } - const { status, body } = - await implementation.actionsUpdateEnvironmentVariable(input, ctx) + const { status, body } = await implementation.reposUploadReleaseAsset( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + ], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDeleteEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), + const reactionsListForReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - router.delete( - "actionsDeleteEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", + const reactionsListForReleaseQuerySchema = z.object({ + content: z + .enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reactionsListForRelease", + "/repos/:owner/:repo/releases/:releaseId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteEnvironmentVariableParamSchema, + reactionsListForReleaseParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput(reactionsListForReleaseQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.actionsDeleteEnvironmentVariable(input, ctx) - - ctx.status = status - return next() - } - ) - - const searchCodeQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["indexed"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("searchCode", "/search/code", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchCodeQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.searchCode(input, ctx) + const { status, body } = await implementation.reactionsListForRelease( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -93677,272 +96248,114 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - score: z.coerce.number(), - file_size: z.coerce.number().optional(), - language: z.coerce.string().optional(), - last_modified_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - line_numbers: z.array(z.coerce.string()).optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - }) - ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", ]), + created_at: z.coerce.string().datetime({ offset: true }), }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reactionsCreateForReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - const searchCommitsQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["author-date", "committer-date"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reactionsCreateForReleaseBodySchema = z.object({ + content: z.enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]), }) - router.get("searchCommits", "/search/commits", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchCommitsQuerySchema, ctx.query), - body: undefined, - } + router.post( + "reactionsCreateForRelease", + "/repos/:owner/:repo/releases/:releaseId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsCreateForReleaseParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reactionsCreateForReleaseBodySchema, ctx.body), + } - const { status, body } = await implementation.searchCommits(input, ctx) + const { status, body } = await implementation.reactionsCreateForRelease( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - comment_count: z.coerce.number(), - message: z.coerce.string(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - author: z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -93965,115 +96378,127 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - ), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsDeleteForReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + reaction_id: z.coerce.number(), + }) + + router.delete( + "reactionsDeleteForRelease", + "/repos/:owner/:repo/releases/:releaseId/reactions/:reactionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsDeleteForReleaseParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reactionsDeleteForRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const secretScanningListAlertsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const secretScanningListAlertsForRepoQuerySchema = z.object({ + state: z.enum(["open", "resolved"]).optional(), + secret_type: z.coerce.string().optional(), + resolution: z.coerce.string().optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + }) + + router.get( + "secretScanningListAlertsForRepo", + "/repos/:owner/:repo/secret-scanning/alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningListAlertsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + secretScanningListAlertsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.secretScanningListAlertsForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number().optional(), created_at: z.coerce .string() .datetime({ offset: true }) @@ -94082,180 +96507,159 @@ export function bootstrap( .string() .datetime({ offset: true }) .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - license: z + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z .object({ - key: z.coerce.string().optional(), name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - }), - score: z.coerce.number(), - node_id: z.coerce.string(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - }) - ), - }) - .parse(body) + }) + ), + ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() - }) - - const searchIssuesAndPullRequestsQuerySchema = z.object({ - q: z.coerce.string(), - sort: z - .enum([ - "comments", - "reactions", - "reactions-+1", - "reactions--1", - "reactions-smile", - "reactions-thinking_face", - "reactions-heart", - "reactions-tada", - "interactions", - "created", - "updated", - ]) - .optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const secretScanningGetAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), }) router.get( - "searchIssuesAndPullRequests", - "/search/issues", + "secretScanningGetAlert", + "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - searchIssuesAndPullRequestsQuerySchema, - ctx.query + params: parseRequestInput( + secretScanningGetAlertParamSchema, + ctx.params ), + query: undefined, body: undefined, } - const { status, body } = await implementation.searchIssuesAndPullRequests( + const { status, body } = await implementation.secretScanningGetAlert( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - title: z.coerce.string(), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - user: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -94277,21 +96681,127 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - description: z.coerce.string().optional(), - }) - ), - state: z.coerce.string(), - state_reason: z.coerce.string().optional(), - assignee: z.object({ + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }), + ], + ["304", z.void()], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const secretScanningUpdateAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), + }) + + const secretScanningUpdateAlertBodySchema = z.object({ + state: z.enum(["open", "resolved"]), + resolution: z + .enum(["null", "false_positive", "wont_fix", "revoked", "used_in_tests"]) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + + router.patch( + "secretScanningUpdateAlert", + "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningUpdateAlertParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(secretScanningUpdateAlertBodySchema, ctx.body), + } + + const { status, body } = await implementation.secretScanningUpdateAlert( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -94313,641 +96823,1387 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - comments: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - body: z.coerce.string().optional(), - score: z.coerce.number(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - draft: z.coerce.boolean().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }), + ], + ["400", z.void()], + ["404", z.void()], + ["422", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const secretScanningListLocationsForAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), + }) + + const secretScanningListLocationsForAlertQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + router.get( + "secretScanningListLocationsForAlert", + "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber/locations", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningListLocationsForAlertParamSchema, + ctx.params + ), + query: parseRequestInput( + secretScanningListLocationsForAlertQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.secretScanningListLocationsForAlert(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + type: z.enum([ + "commit", + "issue_title", + "issue_body", + "issue_comment", + ]), + details: z.union([ + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + blob_sha: z.coerce.string(), + blob_url: z.coerce.string(), + commit_sha: z.coerce.string(), + commit_url: z.coerce.string(), + }), + z.object({ issue_title_url: z.coerce.string() }), + z.object({ issue_body_url: z.coerce.string() }), + z.object({ issue_comment_url: z.coerce.string() }), + ]), + }) + ), + ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activityListStargazersForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const activityListStargazersForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "activityListStargazersForRepo", + "/repos/:owner/:repo/stargazers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListStargazersForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListStargazersForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListStargazersForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.object({})], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCodeFrequencyStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetCodeFrequencyStats", + "/repos/:owner/:repo/stats/code_frequency", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCodeFrequencyStatsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetCodeFrequencyStats( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.array(z.coerce.number()))], + ["202", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCommitActivityStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetCommitActivityStats", + "/repos/:owner/:repo/stats/commit_activity", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCommitActivityStatsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetCommitActivityStats( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + days: z.array(z.coerce.number()), + total: z.coerce.number(), + week: z.coerce.number(), + }) + ), + ], + ["202", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetContributorsStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetContributorsStats", + "/repos/:owner/:repo/stats/contributors", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetContributorsStatsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetContributorsStats( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + total: z.coerce.number(), + weeks: z.array( + z.object({ + w: z.coerce.number().optional(), + a: z.coerce.number().optional(), + d: z.coerce.number().optional(), + c: z.coerce.number().optional(), }) - .optional(), + ), }) ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + ], + ["202", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetParticipationStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetParticipationStats", + "/repos/:owner/:repo/stats/participation", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetParticipationStatsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetParticipationStats( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + all: z.array(z.coerce.number()), + owner: z.array(z.coerce.number()), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetPunchCardStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetPunchCardStats", + "/repos/:owner/:repo/stats/punch_card", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetPunchCardStatsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetPunchCardStats( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.array(z.coerce.number()))], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateCommitStatusParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + sha: z.coerce.string(), + }) + + const reposCreateCommitStatusBodySchema = z.object({ + state: z.enum(["error", "failure", "pending", "success"]), + target_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + context: z.coerce.string().optional(), + }) + + router.post( + "reposCreateCommitStatus", + "/repos/:owner/:repo/statuses/:sha", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateCommitStatusParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposCreateCommitStatusBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateCommitStatus( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activityListWatchersForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const activityListWatchersForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "activityListWatchersForRepo", + "/repos/:owner/:repo/subscribers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListWatchersForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListWatchersForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.activityListWatchersForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activityGetRepoSubscriptionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "activityGetRepoSubscription", + "/repos/:owner/:repo/subscription", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityGetRepoSubscriptionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.activityGetRepoSubscription( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + repository_url: z.coerce.string(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activitySetRepoSubscriptionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const activitySetRepoSubscriptionBodySchema = z + .object({ + subscribed: z.coerce.boolean().optional(), + ignored: z.coerce.boolean().optional(), + }) + .optional() + + router.put( + "activitySetRepoSubscription", + "/repos/:owner/:repo/subscription", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activitySetRepoSubscriptionParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + activitySetRepoSubscriptionBodySchema, + ctx.body + ), } + const { status, body } = await implementation.activitySetRepoSubscription( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + repository_url: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const searchLabelsQuerySchema = z.object({ - repository_id: z.coerce.number(), - q: z.coerce.string(), - sort: z.enum(["created", "updated"]).optional(), - order: z.enum(["desc", "asc"]).optional(), + const activityDeleteRepoSubscriptionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "activityDeleteRepoSubscription", + "/repos/:owner/:repo/subscription", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityDeleteRepoSubscriptionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.activityDeleteRepoSubscription(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListTagsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListTagsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get("searchLabels", "/search/labels", async (ctx, next) => { + router.get("reposListTags", "/repos/:owner/:repo/tags", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput(searchLabelsQuerySchema, ctx.query), + params: parseRequestInput(reposListTagsParamSchema, ctx.params), + query: parseRequestInput(reposListTagsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.searchLabels(input, ctx) + const { status, body } = await implementation.reposListTags(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), name: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - description: z.coerce.string(), - score: z.coerce.number(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + zipball_url: z.coerce.string(), + tarball_url: z.coerce.string(), + node_id: z.coerce.string(), }) ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposListTagProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposListTagProtection", + "/repos/:owner/:repo/tags/protection", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListTagProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposListTagProtection( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateTagProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposCreateTagProtectionBodySchema = z.object({ + pattern: z.coerce.string(), + }) + + router.post( + "reposCreateTagProtection", + "/repos/:owner/:repo/tags/protection", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateTagProtectionParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposCreateTagProtectionBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateTagProtection( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteTagProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + tag_protection_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteTagProtection", + "/repos/:owner/:repo/tags/protection/:tagProtectionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDeleteTagProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeleteTagProtection( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDownloadTarballArchiveParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.get( + "reposDownloadTarballArchive", + "/repos/:owner/:repo/tarball/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDownloadTarballArchiveParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDownloadTarballArchive( + input, + ctx + ) + + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListTeamsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListTeamsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListTeams", + "/repos/:owner/:repo/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListTeamsParamSchema, ctx.params), + query: parseRequestInput(reposListTeamsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListTeams(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetAllTopicsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposGetAllTopicsQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + router.get( + "reposGetAllTopics", + "/repos/:owner/:repo/topics", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetAllTopicsParamSchema, ctx.params), + query: parseRequestInput(reposGetAllTopicsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetAllTopics( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.object({ names: z.array(z.coerce.string()) })], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposReplaceAllTopicsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposReplaceAllTopicsBodySchema = z.object({ + names: z.array(z.coerce.string()), + }) + + router.put( + "reposReplaceAllTopics", + "/repos/:owner/:repo/topics", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposReplaceAllTopicsParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposReplaceAllTopicsBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposReplaceAllTopics( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.object({ names: z.array(z.coerce.string()) })], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetClonesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposGetClonesQuerySchema = z.object({ + per: z.enum(["", "day", "week"]).optional(), + }) + + router.get( + "reposGetClones", + "/repos/:owner/:repo/traffic/clones", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetClonesParamSchema, ctx.params), + query: parseRequestInput(reposGetClonesQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetClones(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + count: z.coerce.number(), + uniques: z.coerce.number(), + clones: z.array( + z.object({ + timestamp: z.coerce.string().datetime({ offset: true }), + uniques: z.coerce.number(), + count: z.coerce.number(), + }) + ), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetTopPathsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetTopPaths", + "/repos/:owner/:repo/traffic/popular/paths", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetTopPathsParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetTopPaths(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + path: z.coerce.string(), + title: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetTopReferrersParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetTopReferrers", + "/repos/:owner/:repo/traffic/popular/referrers", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetTopReferrersParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetTopReferrers( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + referrer: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), }) - ) - .optional(), - }) - .parse(body) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reposGetViewsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const searchReposQuerySchema = z.object({ - q: z.coerce.string(), - sort: z - .enum(["stars", "forks", "help-wanted-issues", "updated"]) - .optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposGetViewsQuerySchema = z.object({ + per: z.enum(["", "day", "week"]).optional(), }) - router.get("searchRepos", "/search/repositories", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchReposQuerySchema, ctx.query), - body: undefined, + router.get( + "reposGetViews", + "/repos/:owner/:repo/traffic/views", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetViewsParamSchema, ctx.params), + query: parseRequestInput(reposGetViewsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetViews(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + count: z.coerce.number(), + uniques: z.coerce.number(), + views: z.array( + z.object({ + timestamp: z.coerce.string().datetime({ offset: true }), + uniques: z.coerce.number(), + count: z.coerce.number(), + }) + ), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.searchRepos(input, ctx) + const reposTransferParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( + const reposTransferBodySchema = z.object({ + new_owner: z.coerce.string(), + new_name: z.coerce.string().optional(), + team_ids: z.array(z.coerce.number()).optional(), + }) + + router.post( + "reposTransfer", + "/repos/:owner/:repo/transfer", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposTransferParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposTransferBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposTransfer(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "202", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), @@ -94981,866 +98237,635 @@ export function bootstrap( description: z.coerce.string(), fork: z.coerce.boolean(), url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - pushed_at: z.coerce.string().datetime({ offset: true }), - homepage: z.coerce.string(), - size: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - open_issues_count: z.coerce.number(), - master_branch: z.coerce.string().optional(), - default_branch: z.coerce.string(), - score: z.coerce.number(), - forks_url: z.coerce.string(), - keys_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - teams_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - events_url: z.coerce.string(), + archive_url: z.coerce.string(), assignees_url: z.coerce.string(), - branches_url: z.coerce.string(), - tags_url: z.coerce.string(), blobs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - trees_url: z.coerce.string(), - statuses_url: z.coerce.string(), - languages_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - contributors_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - commits_url: z.coerce.string(), - git_commits_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), comments_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - contents_url: z.coerce.string(), + commits_url: z.coerce.string(), compare_url: z.coerce.string(), - merges_url: z.coerce.string(), - archive_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), - pulls_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), milestones_url: z.coerce.string(), notifications_url: z.coerce.string(), - labels_url: z.coerce.string(), + pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - deployments_url: z.coerce.string(), - git_url: z.coerce.string(), - ssh_url: z.coerce.string(), - clone_url: z.coerce.string(), - svn_url: z.coerce.string(), - forks: z.coerce.number(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - mirror_url: z.coerce.string(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), permissions: z .object({ - admin: z.coerce.boolean(), + admin: z.coerce.boolean().optional(), maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), + push: z.coerce.boolean().optional(), triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), + pull: z.coerce.boolean().optional(), }) .optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), + role_name: z.coerce.string().optional(), temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), web_commit_signoff_required: z.coerce.boolean().optional(), - }) - ), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() - }) - - const searchTopicsQuerySchema = z.object({ - q: z.coerce.string(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposCheckVulnerabilityAlertsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.get("searchTopics", "/search/topics", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchTopicsQuerySchema, ctx.query), - body: undefined, - } + router.get( + "reposCheckVulnerabilityAlerts", + "/repos/:owner/:repo/vulnerability-alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCheckVulnerabilityAlertsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - const { status, body } = await implementation.searchTopics(input, ctx) + const { status, body } = + await implementation.reposCheckVulnerabilityAlerts(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - short_description: z.coerce.string(), - description: z.coerce.string(), - created_by: z.coerce.string(), - released: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - featured: z.coerce.boolean(), - curated: z.coerce.boolean(), - score: z.coerce.number(), - repository_count: z.coerce.number().optional(), - logo_url: z.coerce.string().optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - related: z - .array( - z.object({ - topic_relation: z - .object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - topic_id: z.coerce.number().optional(), - relation_type: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .optional(), - aliases: z - .array( - z.object({ - topic_relation: z - .object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - topic_id: z.coerce.number().optional(), - relation_type: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .optional(), - }) - ), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() - }) - - const searchUsersQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["followers", "repositories", "joined"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposEnableVulnerabilityAlertsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.get("searchUsers", "/search/users", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchUsersQuerySchema, ctx.query), - body: undefined, - } + router.put( + "reposEnableVulnerabilityAlerts", + "/repos/:owner/:repo/vulnerability-alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposEnableVulnerabilityAlertsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - const { status, body } = await implementation.searchUsers(input, ctx) + const { status, body } = + await implementation.reposEnableVulnerabilityAlerts(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - score: z.coerce.number(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - events_url: z.coerce.string(), - public_repos: z.coerce.number().optional(), - public_gists: z.coerce.number().optional(), - followers: z.coerce.number().optional(), - following: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - name: z.coerce.string().optional(), - bio: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - location: z.coerce.string().optional(), - site_admin: z.coerce.boolean(), - hireable: z.coerce.boolean().optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - blog: z.coerce.string().optional(), - company: z.coerce.string().optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reposDisableVulnerabilityAlertsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsGetLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + router.delete( + "reposDisableVulnerabilityAlerts", + "/repos/:owner/:repo/vulnerability-alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDisableVulnerabilityAlertsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - router.get("teamsGetLegacy", "/teams/:teamId", async (ctx, next) => { - const input = { - params: parseRequestInput(teamsGetLegacyParamSchema, ctx.params), - query: undefined, - body: undefined, + const { status, body } = + await implementation.reposDisableVulnerabilityAlerts(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() } + ) + + const reposDownloadZipballArchiveParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.get( + "reposDownloadZipballArchive", + "/repos/:owner/:repo/zipball/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDownloadZipballArchiveParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - const { status, body } = await implementation.teamsGetLegacy(input, ctx) + const { status, body } = await implementation.reposDownloadZipballArchive( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reposCreateUsingTemplateParamSchema = z.object({ + template_owner: z.coerce.string(), + template_repo: z.coerce.string(), }) - const teamsUpdateLegacyParamSchema = z.object({ team_id: z.coerce.number() }) - - const teamsUpdateLegacyBodySchema = z.object({ + const reposCreateUsingTemplateBodySchema = z.object({ + owner: z.coerce.string().optional(), name: z.coerce.string(), description: z.coerce.string().optional(), - privacy: z.enum(["secret", "closed"]).optional(), - permission: z.enum(["pull", "push", "admin"]).optional(), - parent_team_id: z.coerce.number().optional(), + include_all_branches: z.coerce.boolean().optional(), + private: z.coerce.boolean().optional(), }) - router.patch("teamsUpdateLegacy", "/teams/:teamId", async (ctx, next) => { - const input = { - params: parseRequestInput(teamsUpdateLegacyParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(teamsUpdateLegacyBodySchema, ctx.body), - } + router.post( + "reposCreateUsingTemplate", + "/repos/:templateOwner/:templateRepo/generate", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateUsingTemplateParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposCreateUsingTemplateBodySchema, ctx.body), + } - const { status, body } = await implementation.teamsUpdateLegacy(input, ctx) + const { status, body } = await implementation.reposCreateUsingTemplate( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - ctx.status = status - return next() + const reposListPublicQuerySchema = z.object({ + since: z.coerce.number().optional(), }) - const teamsDeleteLegacyParamSchema = z.object({ team_id: z.coerce.number() }) - - router.delete("teamsDeleteLegacy", "/teams/:teamId", async (ctx, next) => { + router.get("reposListPublic", "/repositories", async (ctx, next) => { const input = { - params: parseRequestInput(teamsDeleteLegacyParamSchema, ctx.params), - query: undefined, + params: undefined, + query: parseRequestInput(reposListPublicQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.teamsDeleteLegacy(input, ctx) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const teamsListDiscussionsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - }) - - const teamsListDiscussionsLegacyQuerySchema = z.object({ - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "teamsListDiscussionsLegacy", - "/teams/:teamId/discussions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsListDiscussionsLegacyParamSchema, - ctx.params - ), - query: parseRequestInput( - teamsListDiscussionsLegacyQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.teamsListDiscussionsLegacy( - input, - ctx - ) + const { status, body } = await implementation.reposListPublic(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - author: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -95863,788 +98888,2241 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - reactions: z + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z .object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), }) .optional(), }) - ) - .parse(body) + ), + ], + ["304", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const actionsListEnvironmentSecretsParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + }) + + const actionsListEnvironmentSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListEnvironmentSecrets", + "/repositories/:repositoryId/environments/:environmentName/secrets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListEnvironmentSecretsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListEnvironmentSecretsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListEnvironmentSecrets(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetEnvironmentPublicKeyParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + }) + + router.get( + "actionsGetEnvironmentPublicKey", + "/repositories/:repositoryId/environments/:environmentName/secrets/public-key", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetEnvironmentPublicKeyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetEnvironmentPublicKey(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetEnvironmentSecretParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.get( + "actionsGetEnvironmentSecret", + "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetEnvironmentSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetEnvironmentSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsCreateOrUpdateEnvironmentSecretParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const actionsCreateOrUpdateEnvironmentSecretBodySchema = z.object({ + encrypted_value: z.coerce.string(), + key_id: z.coerce.string(), + }) + + router.put( + "actionsCreateOrUpdateEnvironmentSecret", + "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsCreateOrUpdateEnvironmentSecretParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsCreateOrUpdateEnvironmentSecretBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsCreateOrUpdateEnvironmentSecret(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteEnvironmentSecretParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.delete( + "actionsDeleteEnvironmentSecret", + "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteEnvironmentSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.actionsDeleteEnvironmentSecret(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsCreateDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), + const actionsListEnvironmentVariablesParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - const teamsCreateDiscussionLegacyBodySchema = z.object({ - title: z.coerce.string(), - body: z.coerce.string(), - private: z.coerce.boolean().optional(), + const actionsListEnvironmentVariablesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListEnvironmentVariables", + "/repositories/:repositoryId/environments/:environmentName/variables", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListEnvironmentVariablesParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListEnvironmentVariablesQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListEnvironmentVariables(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsCreateEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + }) + + const actionsCreateEnvironmentVariableBodySchema = z.object({ + name: z.coerce.string(), + value: z.coerce.string(), }) router.post( - "teamsCreateDiscussionLegacy", - "/teams/:teamId/discussions", + "actionsCreateEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables", async (ctx, next) => { const input = { params: parseRequestInput( - teamsCreateDiscussionLegacyParamSchema, + actionsCreateEnvironmentVariableParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - teamsCreateDiscussionLegacyBodySchema, + actionsCreateEnvironmentVariableBodySchema, ctx.body ), } - const { status, body } = await implementation.teamsCreateDiscussionLegacy( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.actionsCreateEnvironmentVariable(input, ctx) + ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsGetDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const actionsGetEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), }) router.get( - "teamsGetDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber", + "actionsGetEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", async (ctx, next) => { const input = { params: parseRequestInput( - teamsGetDiscussionLegacyParamSchema, + actionsGetEnvironmentVariableParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsGetDiscussionLegacy( - input, - ctx - ) + const { status, body } = + await implementation.actionsGetEnvironmentVariable(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsUpdateDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const actionsUpdateEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), }) - const teamsUpdateDiscussionLegacyBodySchema = z - .object({ - title: z.coerce.string().optional(), - body: z.coerce.string().optional(), - }) - .optional() + const actionsUpdateEnvironmentVariableBodySchema = z.object({ + name: z.coerce.string().optional(), + value: z.coerce.string().optional(), + }) router.patch( - "teamsUpdateDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber", + "actionsUpdateEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", async (ctx, next) => { const input = { params: parseRequestInput( - teamsUpdateDiscussionLegacyParamSchema, + actionsUpdateEnvironmentVariableParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - teamsUpdateDiscussionLegacyBodySchema, + actionsUpdateEnvironmentVariableBodySchema, ctx.body ), } - const { status, body } = await implementation.teamsUpdateDiscussionLegacy( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.actionsUpdateEnvironmentVariable(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsDeleteDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const actionsDeleteEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), }) router.delete( - "teamsDeleteDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber", + "actionsDeleteEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", async (ctx, next) => { const input = { params: parseRequestInput( - teamsDeleteDiscussionLegacyParamSchema, + actionsDeleteEnvironmentVariableParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsDeleteDiscussionLegacy( - input, - ctx - ) + const { status, body } = + await implementation.actionsDeleteEnvironmentVariable(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsListDiscussionCommentsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const searchCodeQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["indexed"]).optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("searchCode", "/search/code", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchCodeQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.searchCode(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + file_size: z.coerce.number().optional(), + language: z.coerce.string().optional(), + last_modified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + line_numbers: z.array(z.coerce.string()).optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - const teamsListDiscussionCommentsLegacyQuerySchema = z.object({ - direction: z.enum(["asc", "desc"]).optional(), + const searchCommitsQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["author-date", "committer-date"]).optional(), + order: z.enum(["desc", "asc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "teamsListDiscussionCommentsLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsListDiscussionCommentsLegacyParamSchema, - ctx.params - ), - query: parseRequestInput( - teamsListDiscussionCommentsLegacyQuerySchema, - ctx.query - ), - body: undefined, - } + router.get("searchCommits", "/search/commits", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchCommitsQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = - await implementation.teamsListDiscussionCommentsLegacy(input, ctx) + const { status, body } = await implementation.searchCommits(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ url: z.coerce.string(), + sha: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ + comments_url: z.coerce.string(), + commit: z.object({ + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + comment_count: z.coerce.number(), + message: z.coerce.string(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsCreateDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - }) - - const teamsCreateDiscussionCommentLegacyBodySchema = z.object({ - body: z.coerce.string(), - }) - - router.post( - "teamsCreateDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsCreateDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsCreateDiscussionCommentLegacyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.teamsCreateDiscussionCommentLegacy(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + node_id: z.coerce.string(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), }) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) + ), + }), + ], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const teamsGetDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), + const searchIssuesAndPullRequestsQuerySchema = z.object({ + q: z.coerce.string(), + sort: z + .enum([ + "comments", + "reactions", + "reactions-+1", + "reactions--1", + "reactions-smile", + "reactions-thinking_face", + "reactions-heart", + "reactions-tada", + "interactions", + "created", + "updated", + ]) + .optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "teamsGetDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", + "searchIssuesAndPullRequests", + "/search/issues", async (ctx, next) => { const input = { - params: parseRequestInput( - teamsGetDiscussionCommentLegacyParamSchema, - ctx.params + params: undefined, + query: parseRequestInput( + searchIssuesAndPullRequestsQuerySchema, + ctx.query ), - query: undefined, body: undefined, } - const { status, body } = - await implementation.teamsGetDiscussionCommentLegacy(input, ctx) + const { status, body } = await implementation.searchIssuesAndPullRequests( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + title: z.coerce.string(), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + description: z.coerce.string().optional(), + }) + ), + state: z.coerce.string(), + state_reason: z.coerce.string().optional(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + comments: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + body: z.coerce.string().optional(), + score: z.coerce.number(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + draft: z.coerce.boolean().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsUpdateDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), - }) - - const teamsUpdateDiscussionCommentLegacyBodySchema = z.object({ - body: z.coerce.string(), + const searchLabelsQuerySchema = z.object({ + repository_id: z.coerce.number(), + q: z.coerce.string(), + sort: z.enum(["created", "updated"]).optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.patch( - "teamsUpdateDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsUpdateDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsUpdateDiscussionCommentLegacyBodySchema, - ctx.body - ), - } + router.get("searchLabels", "/search/labels", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchLabelsQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = - await implementation.teamsUpdateDiscussionCommentLegacy(input, ctx) + const { status, body } = await implementation.searchLabels(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + name: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + description: z.coerce.string(), + score: z.coerce.number(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), }) + ), + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - }) - .parse(body) - } + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - ctx.status = status - return next() + const searchReposQuerySchema = z.object({ + q: z.coerce.string(), + sort: z + .enum(["stars", "forks", "help-wanted-issues", "updated"]) + .optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("searchRepos", "/search/repositories", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchReposQuerySchema, ctx.query), + body: undefined, } - ) - const teamsDeleteDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), - }) + const { status, body } = await implementation.searchRepos(input, ctx) - router.delete( - "teamsDeleteDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsDeleteDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + pushed_at: z.coerce.string().datetime({ offset: true }), + homepage: z.coerce.string(), + size: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + open_issues_count: z.coerce.number(), + master_branch: z.coerce.string().optional(), + default_branch: z.coerce.string(), + score: z.coerce.number(), + forks_url: z.coerce.string(), + keys_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + teams_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + events_url: z.coerce.string(), + assignees_url: z.coerce.string(), + branches_url: z.coerce.string(), + tags_url: z.coerce.string(), + blobs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + trees_url: z.coerce.string(), + statuses_url: z.coerce.string(), + languages_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + contributors_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + commits_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + comments_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + contents_url: z.coerce.string(), + compare_url: z.coerce.string(), + merges_url: z.coerce.string(), + archive_url: z.coerce.string(), + downloads_url: z.coerce.string(), + issues_url: z.coerce.string(), + pulls_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + labels_url: z.coerce.string(), + releases_url: z.coerce.string(), + deployments_url: z.coerce.string(), + git_url: z.coerce.string(), + ssh_url: z.coerce.string(), + clone_url: z.coerce.string(), + svn_url: z.coerce.string(), + forks: z.coerce.number(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + topics: z.array(z.coerce.string()).optional(), + mirror_url: z.coerce.string(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }) + ), + }), + ], + ["304", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const { status, body } = - await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) + const searchTopicsQuerySchema = z.object({ + q: z.coerce.string(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - ctx.status = status - return next() + router.get("searchTopics", "/search/topics", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchTopicsQuerySchema, ctx.query), + body: undefined, } - ) - const reactionsListForTeamDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), + const { status, body } = await implementation.searchTopics(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + short_description: z.coerce.string(), + description: z.coerce.string(), + created_by: z.coerce.string(), + released: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + featured: z.coerce.boolean(), + curated: z.coerce.boolean(), + score: z.coerce.number(), + repository_count: z.coerce.number().optional(), + logo_url: z.coerce.string().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + related: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + aliases: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - const reactionsListForTeamDiscussionCommentLegacyQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), + const searchUsersQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["followers", "repositories", "joined"]).optional(), + order: z.enum(["desc", "asc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "reactionsListForTeamDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsListForTeamDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForTeamDiscussionCommentLegacyQuerySchema, - ctx.query - ), - body: undefined, - } + router.get("searchUsers", "/search/users", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchUsersQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = - await implementation.reactionsListForTeamDiscussionCommentLegacy( - input, - ctx - ) + const { status, body } = await implementation.searchUsers(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), @@ -96653,706 +101131,705 @@ export function bootstrap( url: z.coerce.string(), html_url: z.coerce.string(), followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), subscriptions_url: z.coerce.string(), organizations_url: z.coerce.string(), repos_url: z.coerce.string(), - events_url: z.coerce.string(), received_events_url: z.coerce.string(), type: z.coerce.string(), + score: z.coerce.number(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + events_url: z.coerce.string(), + public_repos: z.coerce.number().optional(), + public_gists: z.coerce.number().optional(), + followers: z.coerce.number().optional(), + following: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + name: z.coerce.string().optional(), + bio: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + location: z.coerce.string().optional(), site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsCreateForTeamDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), + hireable: z.coerce.boolean().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + blog: z.coerce.string().optional(), + company: z.coerce.string().optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - const reactionsCreateForTeamDiscussionCommentLegacyBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) + const teamsGetLegacyParamSchema = z.object({ team_id: z.coerce.number() }) - router.post( - "reactionsCreateForTeamDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForTeamDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reactionsCreateForTeamDiscussionCommentLegacyBodySchema, - ctx.body - ), - } + router.get("teamsGetLegacy", "/teams/:teamId", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsGetLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, + } - const { status, body } = - await implementation.reactionsCreateForTeamDiscussionCommentLegacy( - input, - ctx - ) + const { status, body } = await implementation.teamsGetLegacy(input, ctx) - if (status === 201) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), repos_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsListForTeamDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + ldap_dn: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - const reactionsListForTeamDiscussionLegacyQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const teamsUpdateLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + + const teamsUpdateLegacyBodySchema = z.object({ + name: z.coerce.string(), + description: z.coerce.string().optional(), + privacy: z.enum(["secret", "closed"]).optional(), + permission: z.enum(["pull", "push", "admin"]).optional(), + parent_team_id: z.coerce.number().optional(), }) - router.get( - "reactionsListForTeamDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsListForTeamDiscussionLegacyParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForTeamDiscussionLegacyQuerySchema, - ctx.query - ), - body: undefined, - } + router.patch("teamsUpdateLegacy", "/teams/:teamId", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsUpdateLegacyParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(teamsUpdateLegacyBodySchema, ctx.body), + } - const { status, body } = - await implementation.reactionsListForTeamDiscussionLegacy(input, ctx) + const { status, body } = await implementation.teamsUpdateLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reactionsCreateForTeamDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - }) - - const reactionsCreateForTeamDiscussionLegacyBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) - - router.post( - "reactionsCreateForTeamDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForTeamDiscussionLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reactionsCreateForTeamDiscussionLegacyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reactionsCreateForTeamDiscussionLegacy(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), repos_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsListPendingInvitationsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - }) - - const teamsListPendingInvitationsLegacyQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "teamsListPendingInvitationsLegacy", - "/teams/:teamId/invitations", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsListPendingInvitationsLegacyParamSchema, - ctx.params - ), - query: parseRequestInput( - teamsListPendingInvitationsLegacyQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.teamsListPendingInvitationsLegacy(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + ], + [ + "201", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsListMembersLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - }) - - const teamsListMembersLegacyQuerySchema = z.object({ - role: z.enum(["member", "maintainer", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "teamsListMembersLegacy", - "/teams/:teamId/members", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsListMembersLegacyParamSchema, - ctx.params - ), - query: parseRequestInput(teamsListMembersLegacyQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.teamsListMembersLegacy( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), repos_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsGetMemberLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), - }) - - router.get( - "teamsGetMemberLegacy", - "/teams/:teamId/members/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput(teamsGetMemberLegacyParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsGetMemberLegacy( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const teamsAddMemberLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), - }) - - router.put( - "teamsAddMemberLegacy", - "/teams/:teamId/members/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput(teamsAddMemberLegacyParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsAddMemberLegacy( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsRemoveMemberLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - router.delete( - "teamsRemoveMemberLegacy", - "/teams/:teamId/members/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsRemoveMemberLegacyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsRemoveMemberLegacy( - input, - ctx - ) + const teamsDeleteLegacyParamSchema = z.object({ team_id: z.coerce.number() }) - ctx.status = status - return next() + router.delete("teamsDeleteLegacy", "/teams/:teamId", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsDeleteLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, } - ) - - const teamsGetMembershipForUserLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), - }) - - router.get( - "teamsGetMembershipForUserLegacy", - "/teams/:teamId/memberships/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsGetMembershipForUserLegacyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - const { status, body } = - await implementation.teamsGetMembershipForUserLegacy(input, ctx) + const { status, body } = await implementation.teamsDeleteLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const teamsAddOrUpdateMembershipForUserLegacyParamSchema = z.object({ + const teamsListDiscussionsLegacyParamSchema = z.object({ team_id: z.coerce.number(), - username: z.coerce.string(), }) - const teamsAddOrUpdateMembershipForUserLegacyBodySchema = z - .object({ role: z.enum(["member", "maintainer"]).optional() }) - .optional() - - router.put( - "teamsAddOrUpdateMembershipForUserLegacy", - "/teams/:teamId/memberships/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsAddOrUpdateMembershipForUserLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsAddOrUpdateMembershipForUserLegacyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.teamsAddOrUpdateMembershipForUserLegacy(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsRemoveMembershipForUserLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const teamsListDiscussionsLegacyQuerySchema = z.object({ + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.delete( - "teamsRemoveMembershipForUserLegacy", - "/teams/:teamId/memberships/:username", + router.get( + "teamsListDiscussionsLegacy", + "/teams/:teamId/discussions", async (ctx, next) => { const input = { params: parseRequestInput( - teamsRemoveMembershipForUserLegacyParamSchema, + teamsListDiscussionsLegacyParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + teamsListDiscussionsLegacyQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = - await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) + const { status, body } = await implementation.teamsListDiscussionsLegacy( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsListProjectsLegacyParamSchema = z.object({ + const teamsCreateDiscussionLegacyParamSchema = z.object({ team_id: z.coerce.number(), }) - const teamsListProjectsLegacyQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const teamsCreateDiscussionLegacyBodySchema = z.object({ + title: z.coerce.string(), + body: z.coerce.string(), + private: z.coerce.boolean().optional(), }) - router.get( - "teamsListProjectsLegacy", - "/teams/:teamId/projects", + router.post( + "teamsCreateDiscussionLegacy", + "/teams/:teamId/discussions", async (ctx, next) => { const input = { params: parseRequestInput( - teamsListProjectsLegacyParamSchema, + teamsCreateDiscussionLegacyParamSchema, ctx.params ), - query: parseRequestInput(teamsListProjectsLegacyQuerySchema, ctx.query), - body: undefined, + query: undefined, + body: parseRequestInput( + teamsCreateDiscussionLegacyBodySchema, + ctx.body + ), } - const { status, body } = await implementation.teamsListProjectsLegacy( + const { status, body } = await implementation.teamsCreateDiscussionLegacy( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -97375,281 +101852,176 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsCheckPermissionsForProjectLegacyParamSchema = z.object({ + const teamsGetDiscussionLegacyParamSchema = z.object({ team_id: z.coerce.number(), - project_id: z.coerce.number(), + discussion_number: z.coerce.number(), }) router.get( - "teamsCheckPermissionsForProjectLegacy", - "/teams/:teamId/projects/:projectId", + "teamsGetDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber", async (ctx, next) => { const input = { params: parseRequestInput( - teamsCheckPermissionsForProjectLegacyParamSchema, + teamsGetDiscussionLegacyParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.teamsCheckPermissionsForProjectLegacy(input, ctx) + const { status, body } = await implementation.teamsGetDiscussionLegacy( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsAddOrUpdateProjectPermissionsLegacyParamSchema = z.object({ + const teamsUpdateDiscussionLegacyParamSchema = z.object({ team_id: z.coerce.number(), - project_id: z.coerce.number(), + discussion_number: z.coerce.number(), }) - const teamsAddOrUpdateProjectPermissionsLegacyBodySchema = z - .object({ permission: z.enum(["read", "write", "admin"]).optional() }) + const teamsUpdateDiscussionLegacyBodySchema = z + .object({ + title: z.coerce.string().optional(), + body: z.coerce.string().optional(), + }) .optional() - router.put( - "teamsAddOrUpdateProjectPermissionsLegacy", - "/teams/:teamId/projects/:projectId", + router.patch( + "teamsUpdateDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber", async (ctx, next) => { const input = { params: parseRequestInput( - teamsAddOrUpdateProjectPermissionsLegacyParamSchema, + teamsUpdateDiscussionLegacyParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - teamsAddOrUpdateProjectPermissionsLegacyBodySchema, + teamsUpdateDiscussionLegacyBodySchema, ctx.body ), } - const { status, body } = - await implementation.teamsAddOrUpdateProjectPermissionsLegacy( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsRemoveProjectLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - project_id: z.coerce.number(), - }) - - router.delete( - "teamsRemoveProjectLegacy", - "/teams/:teamId/projects/:projectId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsRemoveProjectLegacyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsRemoveProjectLegacy( - input, - ctx - ) - - if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsListReposLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - }) - - const teamsListReposLegacyQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "teamsListReposLegacy", - "/teams/:teamId/repos", - async (ctx, next) => { - const input = { - params: parseRequestInput(teamsListReposLegacyParamSchema, ctx.params), - query: parseRequestInput(teamsListReposLegacyQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.teamsListReposLegacy( + const { status, body } = await implementation.teamsUpdateDiscussionLegacy( input, ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -97672,347 +102044,115 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + reactions: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsDeleteDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + router.delete( + "teamsDeleteDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsDeleteDiscussionLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = await implementation.teamsDeleteDiscussionLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsCheckPermissionsForRepoLegacyParamSchema = z.object({ + const teamsListDiscussionCommentsLegacyParamSchema = z.object({ team_id: z.coerce.number(), - owner: z.coerce.string(), - repo: z.coerce.string(), + discussion_number: z.coerce.number(), + }) + + const teamsListDiscussionCommentsLegacyQuerySchema = z.object({ + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "teamsCheckPermissionsForRepoLegacy", - "/teams/:teamId/repos/:owner/:repo", + "teamsListDiscussionCommentsLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments", async (ctx, next) => { const input = { params: parseRequestInput( - teamsCheckPermissionsForRepoLegacyParamSchema, + teamsListDiscussionCommentsLegacyParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + teamsListDiscussionCommentsLegacyQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.teamsCheckPermissionsForRepoLegacy(input, ctx) + await implementation.teamsListDiscussionCommentsLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -98028,1052 +102168,402 @@ export function bootstrap( starred_url: z.coerce.string(), subscriptions_url: z.coerce.string(), organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const teamsAddOrUpdateRepoPermissionsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const teamsAddOrUpdateRepoPermissionsLegacyBodySchema = z - .object({ permission: z.enum(["pull", "push", "admin"]).optional() }) - .optional() - - router.put( - "teamsAddOrUpdateRepoPermissionsLegacy", - "/teams/:teamId/repos/:owner/:repo", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsAddOrUpdateRepoPermissionsLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsAddOrUpdateRepoPermissionsLegacyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.teamsAddOrUpdateRepoPermissionsLegacy(input, ctx) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsRemoveRepoLegacyParamSchema = z.object({ + const teamsCreateDiscussionCommentLegacyParamSchema = z.object({ team_id: z.coerce.number(), - owner: z.coerce.string(), - repo: z.coerce.string(), + discussion_number: z.coerce.number(), }) - router.delete( - "teamsRemoveRepoLegacy", - "/teams/:teamId/repos/:owner/:repo", + const teamsCreateDiscussionCommentLegacyBodySchema = z.object({ + body: z.coerce.string(), + }) + + router.post( + "teamsCreateDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments", async (ctx, next) => { const input = { - params: parseRequestInput(teamsRemoveRepoLegacyParamSchema, ctx.params), + params: parseRequestInput( + teamsCreateDiscussionCommentLegacyParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + teamsCreateDiscussionCommentLegacyBodySchema, + ctx.body + ), } - const { status, body } = await implementation.teamsRemoveRepoLegacy( - input, - ctx - ) + const { status, body } = + await implementation.teamsCreateDiscussionCommentLegacy(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const teamsListChildLegacyParamSchema = z.object({ + const teamsGetDiscussionCommentLegacyParamSchema = z.object({ team_id: z.coerce.number(), - }) - - const teamsListChildLegacyQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), }) router.get( - "teamsListChildLegacy", - "/teams/:teamId/teams", + "teamsGetDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", async (ctx, next) => { const input = { - params: parseRequestInput(teamsListChildLegacyParamSchema, ctx.params), - query: parseRequestInput(teamsListChildLegacyQuerySchema, ctx.query), + params: parseRequestInput( + teamsGetDiscussionCommentLegacyParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.teamsListChildLegacy( - input, - ctx - ) + const { status, body } = + await implementation.teamsGetDiscussionCommentLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - router.get("usersGetAuthenticated", "/user", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersGetAuthenticated( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .union([ - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - private_gists: z.coerce.number(), - total_private_repos: z.coerce.number(), - owned_private_repos: z.coerce.number(), - disk_usage: z.coerce.number(), - collaborators: z.coerce.number(), - two_factor_authentication: z.coerce.boolean(), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - business_plus: z.coerce.boolean().optional(), - ldap_dn: z.coerce.string().optional(), - }), - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }), - ]) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const usersUpdateAuthenticatedBodySchema = z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - twitter_username: z.coerce.string().optional(), - company: z.coerce.string().optional(), - location: z.coerce.string().optional(), - hireable: z.coerce.boolean().optional(), - bio: z.coerce.string().optional(), - }) - .optional() - - router.patch("usersUpdateAuthenticated", "/user", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput(usersUpdateAuthenticatedBodySchema, ctx.body), - } - - const { status, body } = await implementation.usersUpdateAuthenticated( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - private_gists: z.coerce.number(), - total_private_repos: z.coerce.number(), - owned_private_repos: z.coerce.number(), - disk_usage: z.coerce.number(), - collaborators: z.coerce.number(), - two_factor_authentication: z.coerce.boolean(), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce.string().datetime({ offset: true }).optional(), - business_plus: z.coerce.boolean().optional(), - ldap_dn: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() + const teamsUpdateDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), }) - const usersListBlockedByAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const teamsUpdateDiscussionCommentLegacyBodySchema = z.object({ + body: z.coerce.string(), }) - router.get( - "usersListBlockedByAuthenticatedUser", - "/user/blocks", + router.patch( + "teamsUpdateDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - usersListBlockedByAuthenticatedUserQuerySchema, - ctx.query + params: parseRequestInput( + teamsUpdateDiscussionCommentLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsUpdateDiscussionCommentLegacyBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.usersListBlockedByAuthenticatedUser(input, ctx) + await implementation.teamsUpdateDiscussionCommentLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersCheckBlockedParamSchema = z.object({ username: z.coerce.string() }) + const teamsDeleteDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), + }) - router.get( - "usersCheckBlocked", - "/user/blocks/:username", + router.delete( + "teamsDeleteDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", async (ctx, next) => { const input = { - params: parseRequestInput(usersCheckBlockedParamSchema, ctx.params), + params: parseRequestInput( + teamsDeleteDiscussionCommentLegacyParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.usersCheckBlocked( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = + await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const usersBlockParamSchema = z.object({ username: z.coerce.string() }) - - router.put("usersBlock", "/user/blocks/:username", async (ctx, next) => { - const input = { - params: parseRequestInput(usersBlockParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersBlock(input, ctx) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const usersUnblockParamSchema = z.object({ username: z.coerce.string() }) - - router.delete("usersUnblock", "/user/blocks/:username", async (ctx, next) => { - const input = { - params: parseRequestInput(usersUnblockParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersUnblock(input, ctx) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() + const reactionsListForTeamDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), }) - const codespacesListForAuthenticatedUserQuerySchema = z.object({ + const reactionsListForTeamDiscussionCommentLegacyQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), }) router.get( - "codespacesListForAuthenticatedUser", - "/user/codespaces", + "reactionsListForTeamDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + reactionsListForTeamDiscussionCommentLegacyParamSchema, + ctx.params + ), query: parseRequestInput( - codespacesListForAuthenticatedUserQuerySchema, + reactionsListForTeamDiscussionCommentLegacyQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.codespacesListForAuthenticatedUser(input, ctx) + await implementation.reactionsListForTeamDiscussionCommentLegacy( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - codespaces: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ + node_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -99096,392 +102586,77 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), }) ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesCreateForAuthenticatedUserBodySchema = z.union([ - z.object({ - repository_id: z.coerce.number(), - ref: z.coerce.string().optional(), - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - multi_repo_permissions_opt_out: z.coerce.boolean().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - display_name: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - }), - z.object({ - pull_request: z.object({ - pull_request_number: z.coerce.number(), - repository_id: z.coerce.number(), - }), - location: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - }), - ]) + const reactionsCreateForTeamDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), + }) + + const reactionsCreateForTeamDiscussionCommentLegacyBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + }) router.post( - "codespacesCreateForAuthenticatedUser", - "/user/codespaces", + "reactionsCreateForTeamDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + reactionsCreateForTeamDiscussionCommentLegacyParamSchema, + ctx.params + ), query: undefined, body: parseRequestInput( - codespacesCreateForAuthenticatedUserBodySchema, + reactionsCreateForTeamDiscussionCommentLegacyBodySchema, ctx.body ), } - const { status, body } = - await implementation.codespacesCreateForAuthenticatedUser(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + const { status, body } = + await implementation.reactionsCreateForTeamDiscussionCommentLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -99504,272 +102679,166 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsListForTeamDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + const reactionsListForTeamDiscussionLegacyQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reactionsListForTeamDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsListForTeamDiscussionLegacyParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForTeamDiscussionLegacyQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reactionsListForTeamDiscussionLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 202) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsCreateForTeamDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + const reactionsCreateForTeamDiscussionLegacyBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + }) + + router.post( + "reactionsCreateForTeamDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsCreateForTeamDiscussionLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reactionsCreateForTeamDiscussionLegacyBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reactionsCreateForTeamDiscussionLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -99787,344 +102856,307 @@ export function bootstrap( organizations_url: z.coerce.string(), repos_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 503) { - ctx.body = z - .object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }) - .parse(body) - } - + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesListSecretsForAuthenticatedUserQuerySchema = z.object({ + const teamsListPendingInvitationsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListPendingInvitationsLegacyQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "codespacesListSecretsForAuthenticatedUser", - "/user/codespaces/secrets", + "teamsListPendingInvitationsLegacy", + "/teams/:teamId/invitations", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + teamsListPendingInvitationsLegacyParamSchema, + ctx.params + ), query: parseRequestInput( - codespacesListSecretsForAuthenticatedUserQuerySchema, + teamsListPendingInvitationsLegacyQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.codespacesListSecretsForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsListPendingInvitationsLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - secrets: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), }) ), - }) - .parse(body) + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsListMembersLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListMembersLegacyQuerySchema = z.object({ + role: z.enum(["member", "maintainer", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "teamsListMembersLegacy", + "/teams/:teamId/members", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsListMembersLegacyParamSchema, + ctx.params + ), + query: parseRequestInput(teamsListMembersLegacyQuerySchema, ctx.query), + body: undefined, } + const { status, body } = await implementation.teamsListMembersLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) + const teamsGetMemberLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) + router.get( - "codespacesGetPublicKeyForAuthenticatedUser", - "/user/codespaces/secrets/public-key", + "teamsGetMemberLegacy", + "/teams/:teamId/members/:username", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput(teamsGetMemberLegacyParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesGetPublicKeyForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.teamsGetMemberLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsAddMemberLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) - if (status === 200) { - ctx.body = z - .object({ key_id: z.coerce.string(), key: z.coerce.string() }) - .parse(body) + router.put( + "teamsAddMemberLegacy", + "/teams/:teamId/members/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsAddMemberLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, } + const { status, body } = await implementation.teamsAddMemberLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["404", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesGetSecretForAuthenticatedUserParamSchema = z.object({ - secret_name: z.coerce.string(), + const teamsRemoveMemberLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) + + router.delete( + "teamsRemoveMemberLegacy", + "/teams/:teamId/members/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsRemoveMemberLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsRemoveMemberLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsGetMembershipForUserLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), }) router.get( - "codespacesGetSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", + "teamsGetMembershipForUserLegacy", + "/teams/:teamId/memberships/:username", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesGetSecretForAuthenticatedUserParamSchema, + teamsGetMembershipForUserLegacyParamSchema, ctx.params ), query: undefined, @@ -100132,154 +103164,475 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesGetSecretForAuthenticatedUser(input, ctx) + await implementation.teamsGetMembershipForUserLegacy(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string(), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsAddOrUpdateMembershipForUserLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) + + const teamsAddOrUpdateMembershipForUserLegacyBodySchema = z + .object({ role: z.enum(["member", "maintainer"]).optional() }) + .optional() + + router.put( + "teamsAddOrUpdateMembershipForUserLegacy", + "/teams/:teamId/memberships/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsAddOrUpdateMembershipForUserLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsAddOrUpdateMembershipForUserLegacyBodySchema, + ctx.body + ), } + const { status, body } = + await implementation.teamsAddOrUpdateMembershipForUserLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), + }), + ], + ["403", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + const teamsRemoveMembershipForUserLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) - const codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema = z.object( - { - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string(), - selected_repository_ids: z.array(z.coerce.string()).optional(), + router.delete( + "teamsRemoveMembershipForUserLegacy", + "/teams/:teamId/memberships/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsRemoveMembershipForUserLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsListProjectsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListProjectsLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "teamsListProjectsLegacy", + "/teams/:teamId/projects", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsListProjectsLegacyParamSchema, + ctx.params + ), + query: parseRequestInput(teamsListProjectsLegacyQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.teamsListProjectsLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCheckPermissionsForProjectLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + project_id: z.coerce.number(), + }) + + router.get( + "teamsCheckPermissionsForProjectLegacy", + "/teams/:teamId/projects/:projectId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCheckPermissionsForProjectLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.teamsCheckPermissionsForProjectLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }), + ], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() } ) + const teamsAddOrUpdateProjectPermissionsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + project_id: z.coerce.number(), + }) + + const teamsAddOrUpdateProjectPermissionsLegacyBodySchema = z + .object({ permission: z.enum(["read", "write", "admin"]).optional() }) + .optional() + router.put( - "codespacesCreateOrUpdateSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", + "teamsAddOrUpdateProjectPermissionsLegacy", + "/teams/:teamId/projects/:projectId", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema, + teamsAddOrUpdateProjectPermissionsLegacyParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema, + teamsAddOrUpdateProjectPermissionsLegacyBodySchema, ctx.body ), } const { status, body } = - await implementation.codespacesCreateOrUpdateSecretForAuthenticatedUser( + await implementation.teamsAddOrUpdateProjectPermissionsLegacy( input, ctx ) - if (status === 201) { - ctx.body = z.object({}).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesDeleteSecretForAuthenticatedUserParamSchema = z.object({ - secret_name: z.coerce.string(), + const teamsRemoveProjectLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + project_id: z.coerce.number(), }) router.delete( - "codespacesDeleteSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", + "teamsRemoveProjectLegacy", + "/teams/:teamId/projects/:projectId", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesDeleteSecretForAuthenticatedUserParamSchema, + teamsRemoveProjectLegacyParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesDeleteSecretForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.teamsRemoveProjectLegacy( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + const teamsListReposLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListReposLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) router.get( - "codespacesListRepositoriesForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories", + "teamsListReposLegacy", + "/teams/:teamId/repos", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(teamsListReposLegacyParamSchema, ctx.params), + query: parseRequestInput(teamsListReposLegacyQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.codespacesListRepositoriesForSecretForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.teamsListReposLegacy( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repositories: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), node_id: z.coerce.string(), @@ -100443,650 +103796,726 @@ export function bootstrap( .optional(), }) ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCheckPermissionsForRepoLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "teamsCheckPermissionsForRepoLegacy", + "/teams/:teamId/repos/:owner/:repo", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCheckPermissionsForRepoLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.teamsCheckPermissionsForRepoLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + }), + ], + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + const teamsAddOrUpdateRepoPermissionsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) - const codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema = - z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + const teamsAddOrUpdateRepoPermissionsLegacyBodySchema = z + .object({ permission: z.enum(["pull", "push", "admin"]).optional() }) + .optional() router.put( - "codespacesSetRepositoriesForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories", + "teamsAddOrUpdateRepoPermissionsLegacy", + "/teams/:teamId/repos/:owner/:repo", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema, + teamsAddOrUpdateRepoPermissionsLegacyParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema, + teamsAddOrUpdateRepoPermissionsLegacyBodySchema, ctx.body ), } const { status, body } = - await implementation.codespacesSetRepositoriesForSecretForAuthenticatedUser( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema = - z.object({ - secret_name: z.coerce.string(), - repository_id: z.coerce.number(), - }) - - router.put( - "codespacesAddRepositoryForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories/:repositoryId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codespacesAddRepositoryForSecretForAuthenticatedUser( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.teamsAddOrUpdateRepoPermissionsLegacy(input, ctx) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema = - z.object({ - secret_name: z.coerce.string(), - repository_id: z.coerce.number(), - }) + const teamsRemoveRepoLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) router.delete( - "codespacesRemoveRepositoryForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + "teamsRemoveRepoLegacy", + "/teams/:teamId/repos/:owner/:repo", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema, - ctx.params - ), + params: parseRequestInput(teamsRemoveRepoLegacyParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesRemoveRepositoryForSecretForAuthenticatedUser( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.teamsRemoveRepoLegacy( + input, + ctx + ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const codespacesGetForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsListChildLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListChildLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "codespacesGetForAuthenticatedUser", - "/user/codespaces/:codespaceName", + "teamsListChildLegacy", + "/teams/:teamId/teams", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesGetForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(teamsListChildLegacyParamSchema, ctx.params), + query: parseRequestInput(teamsListChildLegacyQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.codespacesGetForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.teamsListChildLegacy( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesUpdateForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) - - const codespacesUpdateForAuthenticatedUserBodySchema = z - .object({ - machine: z.coerce.string().optional(), - display_name: z.coerce.string().optional(), - recent_folders: z.array(z.coerce.string()).optional(), - }) - .optional() - - router.patch( - "codespacesUpdateForAuthenticatedUser", - "/user/codespaces/:codespaceName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesUpdateForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - codespacesUpdateForAuthenticatedUserBodySchema, - ctx.body - ), - } + router.get("usersGetAuthenticated", "/user", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } - const { status, body } = - await implementation.codespacesUpdateForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.usersGetAuthenticated( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.union([ + z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), @@ -101105,11 +104534,42 @@ export function bootstrap( received_events_url: z.coerce.string(), type: z.coerce.string(), site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + z.object({ login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), @@ -101128,407 +104588,396 @@ export function bootstrap( received_events_url: z.coerce.string(), type: z.coerce.string(), site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z .object({ - key: z.coerce.string(), + collaborators: z.coerce.number(), name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + space: z.coerce.number(), + private_repos: z.coerce.number(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + suspended_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), + ]), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const usersUpdateAuthenticatedBodySchema = z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + twitter_username: z.coerce.string().optional(), + company: z.coerce.string().optional(), + location: z.coerce.string().optional(), + hireable: z.coerce.boolean().optional(), + bio: z.coerce.string().optional(), + }) + .optional() + + router.patch("usersUpdateAuthenticated", "/user", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput(usersUpdateAuthenticatedBodySchema, ctx.body), + } + + const { status, body } = await implementation.usersUpdateAuthenticated( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), }) .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce + suspended_at: z.coerce .string() .datetime({ offset: true }) .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const usersListBlockedByAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "usersListBlockedByAuthenticatedUser", + "/user/blocks", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + usersListBlockedByAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.usersListBlockedByAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesDeleteForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) + const usersCheckBlockedParamSchema = z.object({ username: z.coerce.string() }) - router.delete( - "codespacesDeleteForAuthenticatedUser", - "/user/codespaces/:codespaceName", + router.get( + "usersCheckBlocked", + "/user/blocks/:username", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesDeleteForAuthenticatedUserParamSchema, - ctx.params - ), + params: parseRequestInput(usersCheckBlockedParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesDeleteForAuthenticatedUser(input, ctx) - - if (status === 202) { - ctx.body = z.object({}).parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const { status, body } = await implementation.usersCheckBlocked( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesExportForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) + const usersBlockParamSchema = z.object({ username: z.coerce.string() }) - router.post( - "codespacesExportForAuthenticatedUser", - "/user/codespaces/:codespaceName/exports", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesExportForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } + router.put("usersBlock", "/user/blocks/:username", async (ctx, next) => { + const input = { + params: parseRequestInput(usersBlockParamSchema, ctx.params), + query: undefined, + body: undefined, + } - const { status, body } = - await implementation.codespacesExportForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.usersBlock(input, ctx) - if (status === 202) { - ctx.body = z - .object({ - state: z.coerce.string().optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - branch: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - id: z.coerce.string().optional(), - export_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ + }), + ], + [ + "422", + z.object({ message: z.coerce.string(), documentation_url: z.coerce.string(), errors: z @@ -101547,248 +104996,484 @@ export function bootstrap( }) ) .optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const codespacesGetExportDetailsForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - export_id: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - router.get( - "codespacesGetExportDetailsForAuthenticatedUser", - "/user/codespaces/:codespaceName/exports/:exportId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesGetExportDetailsForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codespacesGetExportDetailsForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - state: z.coerce.string().optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - branch: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - id: z.coerce.string().optional(), - export_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + const usersUnblockParamSchema = z.object({ username: z.coerce.string() }) - ctx.status = status - return next() + router.delete("usersUnblock", "/user/blocks/:username", async (ctx, next) => { + const input = { + params: parseRequestInput(usersUnblockParamSchema, ctx.params), + query: undefined, + body: undefined, } - ) - - const codespacesCodespaceMachinesForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) - - router.get( - "codespacesCodespaceMachinesForAuthenticatedUser", - "/user/codespaces/:codespaceName/machines", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesCodespaceMachinesForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - const { status, body } = - await implementation.codespacesCodespaceMachinesForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.usersUnblock(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - machines: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }) - ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const codespacesListForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + }) + + router.get( + "codespacesListForAuthenticatedUser", + "/user/codespaces", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + codespacesListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.codespacesListForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce + .string() + .optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesPublishForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) - - const codespacesPublishForAuthenticatedUserBodySchema = z.object({ - name: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - }) + const codespacesCreateForAuthenticatedUserBodySchema = z.union([ + z.object({ + repository_id: z.coerce.number(), + ref: z.coerce.string().optional(), + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + multi_repo_permissions_opt_out: z.coerce.boolean().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + display_name: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + }), + z.object({ + pull_request: z.object({ + pull_request_number: z.coerce.number(), + repository_id: z.coerce.number(), + }), + location: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + }), + ]) router.post( - "codespacesPublishForAuthenticatedUser", - "/user/codespaces/:codespaceName/publish", + "codespacesCreateForAuthenticatedUser", + "/user/codespaces", async (ctx, next) => { const input = { - params: parseRequestInput( - codespacesPublishForAuthenticatedUserParamSchema, - ctx.params - ), + params: undefined, query: undefined, body: parseRequestInput( - codespacesPublishForAuthenticatedUserBodySchema, + codespacesCreateForAuthenticatedUserBodySchema, ctx.body ), } const { status, body } = - await implementation.codespacesPublishForAuthenticatedUser(input, ctx) + await implementation.codespacesCreateForAuthenticatedUser(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -101812,418 +105497,323 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ key: z.coerce.string(), name: z.coerce.string(), url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "202", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - spdx_id: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - organization: z - .object({ + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -102245,358 +105835,519 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ key: z.coerce.string(), name: z.coerce.string(), url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - source: z - .object({ + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesListSecretsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "codespacesListSecretsForAuthenticatedUser", + "/user/codespaces/secrets", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + codespacesListSecretsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesListSecretsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + router.get( + "codespacesGetPublicKeyForAuthenticatedUser", + "/user/codespaces/secrets/public-key", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetPublicKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ key_id: z.coerce.string(), key: z.coerce.string() }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesGetSecretForAuthenticatedUserParamSchema = z.object({ + secret_name: z.coerce.string(), + }) + + router.get( + "codespacesGetSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetSecretForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) + + const codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema = z.object( + { + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string(), + selected_repository_ids: z.array(z.coerce.string()).optional(), + } + ) + + router.put( + "codespacesCreateOrUpdateSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateOrUpdateSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", z.object({})], + ["204", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesDeleteSecretForAuthenticatedUserParamSchema = z.object({ + secret_name: z.coerce.string(), + }) + + router.delete( + "codespacesDeleteSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesDeleteSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesDeleteSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) + + router.get( + "codespacesListRepositoriesForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesListRepositoriesForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -102642,7 +106393,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -102654,754 +106405,383 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + created_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + updated_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z + code_of_conduct: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), }) .optional(), - secret_scanning: z + license: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), }) .optional(), - secret_scanning_push_protection: z + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), }) .optional(), }) - .optional(), + ), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesStartForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - }) + const codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) - router.post( - "codespacesStartForAuthenticatedUser", - "/user/codespaces/:codespaceName/start", + const codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema = + z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + + router.put( + "codespacesSetRepositoriesForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesStartForAuthenticatedUserParamSchema, + codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema, + ctx.body + ), } const { status, body } = - await implementation.codespacesStartForAuthenticatedUser(input, ctx) + await implementation.codespacesSetRepositoriesForSecretForAuthenticatedUser( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 402) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema = + z.object({ + secret_name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.put( + "codespacesAddRepositoryForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesAddRepositoryForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema = + z.object({ + secret_name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.delete( + "codespacesRemoveRepositoryForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.codespacesRemoveRepositoryForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const codespacesStopForAuthenticatedUserParamSchema = z.object({ + const codespacesGetForAuthenticatedUserParamSchema = z.object({ codespace_name: z.coerce.string(), }) - router.post( - "codespacesStopForAuthenticatedUser", - "/user/codespaces/:codespaceName/stop", + router.get( + "codespacesGetForAuthenticatedUser", + "/user/codespaces/:codespaceName", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesStopForAuthenticatedUserParamSchema, + codespacesGetForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -103409,66 +106789,17 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesStopForAuthenticatedUser(input, ctx) + await implementation.codespacesGetForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -103492,741 +106823,676 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 500) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersSetPrimaryEmailVisibilityForAuthenticatedUserBodySchema = z.object( - { visibility: z.enum(["public", "private"]) } - ) - - router.patch( - "usersSetPrimaryEmailVisibilityForAuthenticatedUser", - "/user/email/visibility", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - usersSetPrimaryEmailVisibilityForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.usersSetPrimaryEmailVisibilityForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), }) - ) - .optional(), - }) - .parse(body) - } - + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersListEmailsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codespacesUpdateForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), }) - router.get( - "usersListEmailsForAuthenticatedUser", - "/user/emails", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - usersListEmailsForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.usersListEmailsForAuthenticatedUser(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersAddEmailForAuthenticatedUserBodySchema = z.union([ - z.object({ emails: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - z.coerce.string(), - ]) + const codespacesUpdateForAuthenticatedUserBodySchema = z + .object({ + machine: z.coerce.string().optional(), + display_name: z.coerce.string().optional(), + recent_folders: z.array(z.coerce.string()).optional(), + }) + .optional() - router.post( - "usersAddEmailForAuthenticatedUser", - "/user/emails", + router.patch( + "codespacesUpdateForAuthenticatedUser", + "/user/codespaces/:codespaceName", async (ctx, next) => { const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - usersAddEmailForAuthenticatedUserBodySchema, - ctx.body + params: parseRequestInput( + codespacesUpdateForAuthenticatedUserParamSchema, + ctx.params ), - } - - const { status, body } = - await implementation.usersAddEmailForAuthenticatedUser(input, ctx) - - if (status === 201) { - ctx.body = z - .array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersDeleteEmailForAuthenticatedUserBodySchema = z.union([ - z.object({ emails: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - z.coerce.string(), - ]) - - router.delete( - "usersDeleteEmailForAuthenticatedUser", - "/user/emails", - async (ctx, next) => { - const input = { - params: undefined, query: undefined, body: parseRequestInput( - usersDeleteEmailForAuthenticatedUserBodySchema, + codespacesUpdateForAuthenticatedUserBodySchema, ctx.body ), } const { status, body } = - await implementation.usersDeleteEmailForAuthenticatedUser(input, ctx) + await implementation.codespacesUpdateForAuthenticatedUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersListFollowersForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "usersListFollowersForAuthenticatedUser", - "/user/followers", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - usersListFollowersForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.usersListFollowersForAuthenticatedUser(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersListFollowedByAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "usersListFollowedByAuthenticatedUser", - "/user/following", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - usersListFollowedByAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.usersListFollowedByAuthenticatedUser(input, ctx) - - if (status === 200) { - ctx.body = z - .array( + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersCheckPersonIsFollowedByAuthenticatedParamSchema = z.object({ - username: z.coerce.string(), + const codespacesDeleteForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), }) - router.get( - "usersCheckPersonIsFollowedByAuthenticated", - "/user/following/:username", + router.delete( + "codespacesDeleteForAuthenticatedUser", + "/user/codespaces/:codespaceName", async (ctx, next) => { const input = { params: parseRequestInput( - usersCheckPersonIsFollowedByAuthenticatedParamSchema, + codespacesDeleteForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -104234,367 +107500,67 @@ export function bootstrap( } const { status, body } = - await implementation.usersCheckPersonIsFollowedByAuthenticated( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersFollowParamSchema = z.object({ username: z.coerce.string() }) - - router.put("usersFollow", "/user/following/:username", async (ctx, next) => { - const input = { - params: parseRequestInput(usersFollowParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersFollow(input, ctx) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - }) - - const usersUnfollowParamSchema = z.object({ username: z.coerce.string() }) - - router.delete( - "usersUnfollow", - "/user/following/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput(usersUnfollowParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersUnfollow(input, ctx) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersListGpgKeysForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "usersListGpgKeysForAuthenticatedUser", - "/user/gpg_keys", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - usersListGpgKeysForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.usersListGpgKeysForAuthenticatedUser(input, ctx) + await implementation.codespacesDeleteForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + ["304", z.void()], + [ + "401", z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersCreateGpgKeyForAuthenticatedUserBodySchema = z.object({ - name: z.coerce.string().optional(), - armored_public_key: z.coerce.string(), + const codespacesExportForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), }) router.post( - "usersCreateGpgKeyForAuthenticatedUser", - "/user/gpg_keys", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - usersCreateGpgKeyForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.usersCreateGpgKeyForAuthenticatedUser(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const usersGetGpgKeyForAuthenticatedUserParamSchema = z.object({ - gpg_key_id: z.coerce.number(), - }) - - router.get( - "usersGetGpgKeyForAuthenticatedUser", - "/user/gpg_keys/:gpgKeyId", + "codespacesExportForAuthenticatedUser", + "/user/codespaces/:codespaceName/exports", async (ctx, next) => { const input = { params: parseRequestInput( - usersGetGpgKeyForAuthenticatedUserParamSchema, + codespacesExportForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -104602,95 +107568,104 @@ export function bootstrap( } const { status, body } = - await implementation.usersGetGpgKeyForAuthenticatedUser(input, ctx) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.codespacesExportForAuthenticatedUser(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "202", + z.object({ + state: z.coerce.string().optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + branch: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + id: z.coerce.string().optional(), + export_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersDeleteGpgKeyForAuthenticatedUserParamSchema = z.object({ - gpg_key_id: z.coerce.number(), + const codespacesGetExportDetailsForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + export_id: z.coerce.string(), }) - router.delete( - "usersDeleteGpgKeyForAuthenticatedUser", - "/user/gpg_keys/:gpgKeyId", + router.get( + "codespacesGetExportDetailsForAuthenticatedUser", + "/user/codespaces/:codespaceName/exports/:exportId", async (ctx, next) => { const input = { params: parseRequestInput( - usersDeleteGpgKeyForAuthenticatedUserParamSchema, + codespacesGetExportDetailsForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -104698,163 +107673,225 @@ export function bootstrap( } const { status, body } = - await implementation.usersDeleteGpgKeyForAuthenticatedUser(input, ctx) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } + await implementation.codespacesGetExportDetailsForAuthenticatedUser( + input, + ctx + ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + state: z.coerce.string().optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + branch: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + id: z.coerce.string().optional(), + export_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsListInstallationsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codespacesCodespaceMachinesForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), }) router.get( - "appsListInstallationsForAuthenticatedUser", - "/user/installations", + "codespacesCodespaceMachinesForAuthenticatedUser", + "/user/codespaces/:codespaceName/machines", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - appsListInstallationsForAuthenticatedUserQuerySchema, - ctx.query + params: parseRequestInput( + codespacesCodespaceMachinesForAuthenticatedUserParamSchema, + ctx.params ), + query: undefined, body: undefined, } const { status, body } = - await implementation.appsListInstallationsForAuthenticatedUser( + await implementation.codespacesCodespaceMachinesForAuthenticatedUser( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - installations: z.array( - z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + machines: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }) + ), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesPublishForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + const codespacesPublishForAuthenticatedUserBodySchema = z.object({ + name: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + }) + + router.post( + "codespacesPublishForAuthenticatedUser", + "/user/codespaces/:codespaceName/publish", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesPublishForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesPublishForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesPublishForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -104877,79 +107914,410 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - ), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsListInstallationReposForAuthenticatedUserParamSchema = z.object({ - installation_id: z.coerce.number(), - }) - - const appsListInstallationReposForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "appsListInstallationReposForAuthenticatedUser", - "/user/installations/:installationId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsListInstallationReposForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - appsListInstallationReposForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.appsListInstallationReposForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - total_count: z.coerce.number(), - repository_selection: z.coerce.string().optional(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), license: z.object({ key: z.coerce.string(), name: z.coerce.string(), @@ -104983,213 +108351,580 @@ export function bootstrap( starred_at: z.coerce.string().optional(), }) .optional(), - forks: z.coerce.number(), - permissions: z + parent: z .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + forks: z.coerce.number(), permissions: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -105211,79 +108946,191 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), open_issues: z.coerce.number(), watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsAddRepoToInstallationForAuthenticatedUserParamSchema = z.object({ - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), + const codespacesStartForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), }) - router.put( - "appsAddRepoToInstallationForAuthenticatedUser", - "/user/installations/:installationId/repositories/:repositoryId", + router.post( + "codespacesStartForAuthenticatedUser", + "/user/codespaces/:codespaceName/start", async (ctx, next) => { const input = { params: parseRequestInput( - appsAddRepoToInstallationForAuthenticatedUserParamSchema, + codespacesStartForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -105291,49 +109138,383 @@ export function bootstrap( } const { status, body } = - await implementation.appsAddRepoToInstallationForAuthenticatedUser( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.codespacesStartForAuthenticatedUser(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "402", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsRemoveRepoFromInstallationForAuthenticatedUserParamSchema = - z.object({ - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) + const codespacesStopForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) - router.delete( - "appsRemoveRepoFromInstallationForAuthenticatedUser", - "/user/installations/:installationId/repositories/:repositoryId", + router.post( + "codespacesStopForAuthenticatedUser", + "/user/codespaces/:codespaceName/stop", async (ctx, next) => { const input = { params: parseRequestInput( - appsRemoveRepoFromInstallationForAuthenticatedUserParamSchema, + codespacesStopForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -105341,203 +109522,18 @@ export function bootstrap( } const { status, body } = - await implementation.appsRemoveRepoFromInstallationForAuthenticatedUser( - input, - ctx - ) - - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - router.get( - "interactionsGetRestrictionsForAuthenticatedUser", - "/user/interaction-limits", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.interactionsGetRestrictionsForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z.object({}).parse(body) - } - - ctx.status = status - return next() - } - ) - - const interactionsSetRestrictionsForAuthenticatedUserBodySchema = z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - expiry: z - .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) - .optional(), - }) - - router.put( - "interactionsSetRestrictionsForAuthenticatedUser", - "/user/interaction-limits", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - interactionsSetRestrictionsForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.interactionsSetRestrictionsForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - origin: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - router.delete( - "interactionsRemoveRestrictionsForAuthenticatedUser", - "/user/interaction-limits", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.interactionsRemoveRestrictionsForAuthenticatedUser( - input, - ctx - ) - - ctx.status = status - return next() - } - ) - - const issuesListForAuthenticatedUserQuerySchema = z.object({ - filter: z - .enum(["assigned", "created", "mentioned", "subscribed", "repos", "all"]) - .optional(), - state: z.enum(["open", "closed", "all"]).optional(), - labels: z.coerce.string().optional(), - sort: z.enum(["created", "updated", "comments"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListForAuthenticatedUser", - "/user/issues", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - issuesListForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.issuesListForAuthenticatedUser(input, ctx) + await implementation.codespacesStopForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -105560,21 +109556,7 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + billable_owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -105597,44 +109579,12 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -105657,629 +109607,767 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", ]), - reactions: z + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), }) .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "500", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersSetPrimaryEmailVisibilityForAuthenticatedUserBodySchema = z.object( + { visibility: z.enum(["public", "private"]) } + ) + + router.patch( + "usersSetPrimaryEmailVisibilityForAuthenticatedUser", + "/user/email/visibility", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + usersSetPrimaryEmailVisibilityForAuthenticatedUserBodySchema, + ctx.body + ), } + const { status, body } = + await implementation.usersSetPrimaryEmailVisibilityForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersListPublicSshKeysForAuthenticatedUserQuerySchema = z.object({ + const usersListEmailsForAuthenticatedUserQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "usersListPublicSshKeysForAuthenticatedUser", - "/user/keys", + "usersListEmailsForAuthenticatedUser", + "/user/emails", async (ctx, next) => { const input = { params: undefined, query: parseRequestInput( - usersListPublicSshKeysForAuthenticatedUserQuerySchema, + usersListEmailsForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.usersListPublicSshKeysForAuthenticatedUser( - input, - ctx - ) + await implementation.usersListEmailsForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - url: z.coerce.string(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - verified: z.coerce.boolean(), - read_only: z.coerce.boolean(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersAddEmailForAuthenticatedUserBodySchema = z.union([ + z.object({ emails: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + z.coerce.string(), + ]) + + router.post( + "usersAddEmailForAuthenticatedUser", + "/user/emails", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + usersAddEmailForAuthenticatedUserBodySchema, + ctx.body + ), } + const { status, body } = + await implementation.usersAddEmailForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersCreatePublicSshKeyForAuthenticatedUserBodySchema = z.object({ - title: z.coerce.string().optional(), - key: z.coerce.string(), - }) + const usersDeleteEmailForAuthenticatedUserBodySchema = z.union([ + z.object({ emails: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + z.coerce.string(), + ]) - router.post( - "usersCreatePublicSshKeyForAuthenticatedUser", - "/user/keys", + router.delete( + "usersDeleteEmailForAuthenticatedUser", + "/user/emails", async (ctx, next) => { const input = { params: undefined, query: undefined, body: parseRequestInput( - usersCreatePublicSshKeyForAuthenticatedUserBodySchema, + usersDeleteEmailForAuthenticatedUserBodySchema, ctx.body ), } const { status, body } = - await implementation.usersCreatePublicSshKeyForAuthenticatedUser( - input, - ctx - ) + await implementation.usersDeleteEmailForAuthenticatedUser(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - key: z.coerce.string(), - id: z.coerce.number(), - url: z.coerce.string(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - verified: z.coerce.boolean(), - read_only: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersListFollowersForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "usersListFollowersForAuthenticatedUser", + "/user/followers", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + usersListFollowersForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.usersListFollowersForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersListFollowedByAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "usersListFollowedByAuthenticatedUser", + "/user/following", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + usersListFollowedByAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.usersListFollowedByAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersGetPublicSshKeyForAuthenticatedUserParamSchema = z.object({ - key_id: z.coerce.number(), + const usersCheckPersonIsFollowedByAuthenticatedParamSchema = z.object({ + username: z.coerce.string(), }) router.get( - "usersGetPublicSshKeyForAuthenticatedUser", - "/user/keys/:keyId", + "usersCheckPersonIsFollowedByAuthenticated", + "/user/following/:username", async (ctx, next) => { const input = { params: parseRequestInput( - usersGetPublicSshKeyForAuthenticatedUserParamSchema, + usersCheckPersonIsFollowedByAuthenticatedParamSchema, ctx.params ), query: undefined, @@ -106287,415 +110375,390 @@ export function bootstrap( } const { status, body } = - await implementation.usersGetPublicSshKeyForAuthenticatedUser( + await implementation.usersCheckPersonIsFollowedByAuthenticated( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - key: z.coerce.string(), - id: z.coerce.number(), - url: z.coerce.string(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - verified: z.coerce.boolean(), - read_only: z.coerce.boolean(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const usersDeletePublicSshKeyForAuthenticatedUserParamSchema = z.object({ - key_id: z.coerce.number(), - }) + const usersFollowParamSchema = z.object({ username: z.coerce.string() }) - router.delete( - "usersDeletePublicSshKeyForAuthenticatedUser", - "/user/keys/:keyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - usersDeletePublicSshKeyForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } + router.put("usersFollow", "/user/following/:username", async (ctx, next) => { + const input = { + params: parseRequestInput(usersFollowParamSchema, ctx.params), + query: undefined, + body: undefined, + } - const { status, body } = - await implementation.usersDeletePublicSshKeyForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.usersFollow(input, ctx) - if (status === 401) { - ctx.body = z - .object({ + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ + }), + ], + [ + "403", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ + }), + ], + [ + "404", + z.object({ message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const appsListSubscriptionsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() }) - router.get( - "appsListSubscriptionsForAuthenticatedUser", - "/user/marketplace_purchases", + const usersUnfollowParamSchema = z.object({ username: z.coerce.string() }) + + router.delete( + "usersUnfollow", + "/user/following/:username", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - appsListSubscriptionsForAuthenticatedUserQuerySchema, - ctx.query - ), + params: parseRequestInput(usersUnfollowParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = - await implementation.appsListSubscriptionsForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.usersUnfollow(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", z.object({ - billing_cycle: z.coerce.string(), - next_billing_date: z.coerce.string().datetime({ offset: true }), - unit_count: z.coerce.number(), - on_free_trial: z.coerce.boolean(), - free_trial_ends_on: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - account: z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - type: z.coerce.string(), - node_id: z.coerce.string().optional(), - login: z.coerce.string(), - email: z.coerce.string().email().optional(), - organization_billing_email: z.coerce - .string() - .email() - .optional(), - }), - plan: z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema = z.object({ + const usersListGpgKeysForAuthenticatedUserQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "appsListSubscriptionsForAuthenticatedUserStubbed", - "/user/marketplace_purchases/stubbed", + "usersListGpgKeysForAuthenticatedUser", + "/user/gpg_keys", async (ctx, next) => { const input = { params: undefined, query: parseRequestInput( - appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema, + usersListGpgKeysForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.appsListSubscriptionsForAuthenticatedUserStubbed( - input, - ctx - ) + await implementation.usersListGpgKeysForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - billing_cycle: z.coerce.string(), - next_billing_date: z.coerce.string().datetime({ offset: true }), - unit_count: z.coerce.number(), - on_free_trial: z.coerce.boolean(), - free_trial_ends_on: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - account: z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - type: z.coerce.string(), - node_id: z.coerce.string().optional(), - login: z.coerce.string(), - email: z.coerce.string().email().optional(), - organization_billing_email: z.coerce - .string() - .email() - .optional(), - }), - plan: z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsListMembershipsForAuthenticatedUserQuerySchema = z.object({ - state: z.enum(["active", "pending"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const usersCreateGpgKeyForAuthenticatedUserBodySchema = z.object({ + name: z.coerce.string().optional(), + armored_public_key: z.coerce.string(), }) - router.get( - "orgsListMembershipsForAuthenticatedUser", - "/user/memberships/orgs", + router.post( + "usersCreateGpgKeyForAuthenticatedUser", + "/user/gpg_keys", async (ctx, next) => { const input = { params: undefined, - query: parseRequestInput( - orgsListMembershipsForAuthenticatedUserQuerySchema, - ctx.query + query: undefined, + body: parseRequestInput( + usersCreateGpgKeyForAuthenticatedUserBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.orgsListMembershipsForAuthenticatedUser(input, ctx) + await implementation.usersCreateGpgKeyForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), }) - ) - .optional(), - }) - .parse(body) - } - + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsGetMembershipForAuthenticatedUserParamSchema = z.object({ - org: z.coerce.string(), + const usersGetGpgKeyForAuthenticatedUserParamSchema = z.object({ + gpg_key_id: z.coerce.number(), }) router.get( - "orgsGetMembershipForAuthenticatedUser", - "/user/memberships/orgs/:org", + "usersGetGpgKeyForAuthenticatedUser", + "/user/gpg_keys/:gpgKeyId", async (ctx, next) => { const input = { params: parseRequestInput( - orgsGetMembershipForAuthenticatedUserParamSchema, + usersGetGpgKeyForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -106703,267 +110766,365 @@ export function bootstrap( } const { status, body } = - await implementation.orgsGetMembershipForAuthenticatedUser(input, ctx) + await implementation.usersGetGpgKeyForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsUpdateMembershipForAuthenticatedUserParamSchema = z.object({ - org: z.coerce.string(), - }) - - const orgsUpdateMembershipForAuthenticatedUserBodySchema = z.object({ - state: z.enum(["active"]), + const usersDeleteGpgKeyForAuthenticatedUserParamSchema = z.object({ + gpg_key_id: z.coerce.number(), }) - router.patch( - "orgsUpdateMembershipForAuthenticatedUser", - "/user/memberships/orgs/:org", + router.delete( + "usersDeleteGpgKeyForAuthenticatedUser", + "/user/gpg_keys/:gpgKeyId", async (ctx, next) => { const input = { params: parseRequestInput( - orgsUpdateMembershipForAuthenticatedUserParamSchema, + usersDeleteGpgKeyForAuthenticatedUserParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - orgsUpdateMembershipForAuthenticatedUserBodySchema, - ctx.body + body: undefined, + } + + const { status, body } = + await implementation.usersDeleteGpgKeyForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListInstallationsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListInstallationsForAuthenticatedUser", + "/user/installations", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListInstallationsForAuthenticatedUserQuerySchema, + ctx.query ), + body: undefined, } const { status, body } = - await implementation.orgsUpdateMembershipForAuthenticatedUser( + await implementation.appsListInstallationsForAuthenticatedUser( input, ctx ) - if (status === 200) { - ctx.body = z - .object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + installations: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z + .enum(["read", "write"]) + .optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), }) - ) - .optional(), - }) - .parse(body) - } - + ), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsListForAuthenticatedUserQuerySchema = z.object({ + const appsListInstallationReposForAuthenticatedUserParamSchema = z.object({ + installation_id: z.coerce.number(), + }) + + const appsListInstallationReposForAuthenticatedUserQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "migrationsListForAuthenticatedUser", - "/user/migrations", + "appsListInstallationReposForAuthenticatedUser", + "/user/installations/:installationId/repositories", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + appsListInstallationReposForAuthenticatedUserParamSchema, + ctx.params + ), query: parseRequestInput( - migrationsListForAuthenticatedUserQuerySchema, + appsListInstallationReposForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.migrationsListForAuthenticatedUser(input, ctx) + await implementation.appsListInstallationReposForAuthenticatedUser( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), + total_count: z.coerce.number(), + repository_selection: z.coerce.string().optional(), repositories: z.array( z.object({ id: z.coerce.number(), @@ -107265,120 +111426,420 @@ export function bootstrap( anonymous_access_enabled: z.coerce.boolean().optional(), }) ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + }), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsAddRepoToInstallationForAuthenticatedUserParamSchema = z.object({ + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + + router.put( + "appsAddRepoToInstallationForAuthenticatedUser", + "/user/installations/:installationId/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsAddRepoToInstallationForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.appsAddRepoToInstallationForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsStartForAuthenticatedUserBodySchema = z.object({ - lock_repositories: z.coerce.boolean().optional(), - exclude_metadata: z.coerce.boolean().optional(), - exclude_git_data: z.coerce.boolean().optional(), - exclude_attachments: z.coerce.boolean().optional(), - exclude_releases: z.coerce.boolean().optional(), - exclude_owner_projects: z.coerce.boolean().optional(), - org_metadata_only: z.coerce.boolean().optional(), - exclude: z.array(z.enum(["repositories"])).optional(), - repositories: z.array(z.coerce.string()), + const appsRemoveRepoFromInstallationForAuthenticatedUserParamSchema = + z.object({ + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + + router.delete( + "appsRemoveRepoFromInstallationForAuthenticatedUser", + "/user/installations/:installationId/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsRemoveRepoFromInstallationForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.appsRemoveRepoFromInstallationForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + router.get( + "interactionsGetRestrictionsForAuthenticatedUser", + "/user/interaction-limits", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.interactionsGetRestrictionsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.object({})], + ["204", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const interactionsSetRestrictionsForAuthenticatedUserBodySchema = z.object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + expiry: z + .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) + .optional(), }) - router.post( - "migrationsStartForAuthenticatedUser", - "/user/migrations", + router.put( + "interactionsSetRestrictionsForAuthenticatedUser", + "/user/interaction-limits", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + interactionsSetRestrictionsForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.interactionsSetRestrictionsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + limit: z.enum([ + "existing_users", + "contributors_only", + "collaborators_only", + ]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + router.delete( + "interactionsRemoveRestrictionsForAuthenticatedUser", + "/user/interaction-limits", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.interactionsRemoveRestrictionsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const issuesListForAuthenticatedUserQuerySchema = z.object({ + filter: z + .enum(["assigned", "created", "mentioned", "subscribed", "repos", "all"]) + .optional(), + state: z.enum(["open", "closed", "all"]).optional(), + labels: z.coerce.string().optional(), + sort: z.enum(["created", "updated", "comments"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListForAuthenticatedUser", + "/user/issues", async (ctx, next) => { const input = { params: undefined, - query: undefined, - body: parseRequestInput( - migrationsStartForAuthenticatedUserBodySchema, - ctx.body + query: parseRequestInput( + issuesListForAuthenticatedUserQuerySchema, + ctx.query ), + body: undefined, } const { status, body } = - await implementation.migrationsStartForAuthenticatedUser(input, ctx) + await implementation.issuesListForAuthenticatedUser(input, ctx) - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - spdx_id: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - organization: z - .object({ + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -107400,215 +111861,332 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), }) .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + draft: z.coerce.boolean().optional(), + closed_by: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -107630,209 +112208,647 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ], + ["304", z.void()], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersListPublicSshKeysForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "usersListPublicSshKeysForAuthenticatedUser", + "/user/keys", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + usersListPublicSshKeysForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.usersListPublicSshKeysForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersCreatePublicSshKeyForAuthenticatedUserBodySchema = z.object({ + title: z.coerce.string().optional(), + key: z.coerce.string(), + }) + + router.post( + "usersCreatePublicSshKeyForAuthenticatedUser", + "/user/keys", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + usersCreatePublicSshKeyForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.usersCreatePublicSshKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersGetPublicSshKeyForAuthenticatedUserParamSchema = z.object({ + key_id: z.coerce.number(), + }) + + router.get( + "usersGetPublicSshKeyForAuthenticatedUser", + "/user/keys/:keyId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + usersGetPublicSshKeyForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.usersGetPublicSshKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersDeletePublicSshKeyForAuthenticatedUserParamSchema = z.object({ + key_id: z.coerce.number(), + }) + + router.delete( + "usersDeletePublicSshKeyForAuthenticatedUser", + "/user/keys/:keyId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + usersDeletePublicSshKeyForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.usersDeletePublicSshKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListSubscriptionsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListSubscriptionsForAuthenticatedUser", + "/user/marketplace_purchases", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListSubscriptionsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = + await implementation.appsListSubscriptionsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + billing_cycle: z.coerce.string(), + next_billing_date: z.coerce.string().datetime({ offset: true }), + unit_count: z.coerce.number(), + on_free_trial: z.coerce.boolean(), + free_trial_ends_on: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + account: z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + type: z.coerce.string(), + node_id: z.coerce.string().optional(), + login: z.coerce.string(), + email: z.coerce.string().email().optional(), + organization_billing_email: z.coerce + .string() + .email() + .optional(), + }), + plan: z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsGetStatusForAuthenticatedUserParamSchema = z.object({ - migration_id: z.coerce.number(), + const appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - const migrationsGetStatusForAuthenticatedUserQuerySchema = z.object({ - exclude: z.array(z.coerce.string()).optional(), + router.get( + "appsListSubscriptionsForAuthenticatedUserStubbed", + "/user/marketplace_purchases/stubbed", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.appsListSubscriptionsForAuthenticatedUserStubbed( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + billing_cycle: z.coerce.string(), + next_billing_date: z.coerce.string().datetime({ offset: true }), + unit_count: z.coerce.number(), + on_free_trial: z.coerce.boolean(), + free_trial_ends_on: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + account: z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + type: z.coerce.string(), + node_id: z.coerce.string().optional(), + login: z.coerce.string(), + email: z.coerce.string().email().optional(), + organization_billing_email: z.coerce + .string() + .email() + .optional(), + }), + plan: z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsListMembershipsForAuthenticatedUserQuerySchema = z.object({ + state: z.enum(["active", "pending"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "migrationsGetStatusForAuthenticatedUser", - "/user/migrations/:migrationId", + "orgsListMembershipsForAuthenticatedUser", + "/user/memberships/orgs", async (ctx, next) => { const input = { - params: parseRequestInput( - migrationsGetStatusForAuthenticatedUserParamSchema, - ctx.params - ), + params: undefined, query: parseRequestInput( - migrationsGetStatusForAuthenticatedUserQuerySchema, + orgsListMembershipsForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.migrationsGetStatusForAuthenticatedUser(input, ctx) + await implementation.orgsListMembershipsForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -107855,476 +112871,722 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsGetMembershipForAuthenticatedUserParamSchema = z.object({ + org: z.coerce.string(), + }) + + router.get( + "orgsGetMembershipForAuthenticatedUser", + "/user/memberships/orgs/:org", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsGetMembershipForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.orgsGetMembershipForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsGetArchiveForAuthenticatedUserParamSchema = z.object({ - migration_id: z.coerce.number(), + const orgsUpdateMembershipForAuthenticatedUserParamSchema = z.object({ + org: z.coerce.string(), }) - router.get( - "migrationsGetArchiveForAuthenticatedUser", - "/user/migrations/:migrationId/archive", + const orgsUpdateMembershipForAuthenticatedUserBodySchema = z.object({ + state: z.enum(["active"]), + }) + + router.patch( + "orgsUpdateMembershipForAuthenticatedUser", + "/user/memberships/orgs/:org", async (ctx, next) => { const input = { params: parseRequestInput( - migrationsGetArchiveForAuthenticatedUserParamSchema, + orgsUpdateMembershipForAuthenticatedUserParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + orgsUpdateMembershipForAuthenticatedUserBodySchema, + ctx.body + ), } const { status, body } = - await implementation.migrationsGetArchiveForAuthenticatedUser( + await implementation.orgsUpdateMembershipForAuthenticatedUser( input, ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsDeleteArchiveForAuthenticatedUserParamSchema = z.object({ - migration_id: z.coerce.number(), + const migrationsListForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.delete( - "migrationsDeleteArchiveForAuthenticatedUser", - "/user/migrations/:migrationId/archive", + router.get( + "migrationsListForAuthenticatedUser", + "/user/migrations", async (ctx, next) => { const input = { - params: parseRequestInput( - migrationsDeleteArchiveForAuthenticatedUserParamSchema, - ctx.params + params: undefined, + query: parseRequestInput( + migrationsListForAuthenticatedUserQuerySchema, + ctx.query ), - query: undefined, body: undefined, } const { status, body } = - await implementation.migrationsDeleteArchiveForAuthenticatedUser( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } + await implementation.migrationsListForAuthenticatedUser(input, ctx) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const migrationsUnlockRepoForAuthenticatedUserParamSchema = z.object({ - migration_id: z.coerce.number(), - repo_name: z.coerce.string(), + const migrationsStartForAuthenticatedUserBodySchema = z.object({ + lock_repositories: z.coerce.boolean().optional(), + exclude_metadata: z.coerce.boolean().optional(), + exclude_git_data: z.coerce.boolean().optional(), + exclude_attachments: z.coerce.boolean().optional(), + exclude_releases: z.coerce.boolean().optional(), + exclude_owner_projects: z.coerce.boolean().optional(), + org_metadata_only: z.coerce.boolean().optional(), + exclude: z.array(z.enum(["repositories"])).optional(), + repositories: z.array(z.coerce.string()), }) - router.delete( - "migrationsUnlockRepoForAuthenticatedUser", - "/user/migrations/:migrationId/repos/:repoName/lock", + router.post( + "migrationsStartForAuthenticatedUser", + "/user/migrations", async (ctx, next) => { const input = { - params: parseRequestInput( - migrationsUnlockRepoForAuthenticatedUserParamSchema, - ctx.params - ), + params: undefined, query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.migrationsUnlockRepoForAuthenticatedUser( - input, - ctx - ) - - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const migrationsListReposForAuthenticatedUserParamSchema = z.object({ - migration_id: z.coerce.number(), - }) - - const migrationsListReposForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "migrationsListReposForAuthenticatedUser", - "/user/migrations/:migrationId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsListReposForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - migrationsListReposForAuthenticatedUserQuerySchema, - ctx.query + body: parseRequestInput( + migrationsStartForAuthenticatedUserBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.migrationsListReposForAuthenticatedUser(input, ctx) + await implementation.migrationsStartForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -108348,303 +113610,488 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - }) - ) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const orgsListForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const migrationsGetStatusForAuthenticatedUserParamSchema = z.object({ + migration_id: z.coerce.number(), }) - router.get( - "orgsListForAuthenticatedUser", - "/user/orgs", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - orgsListForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.orgsListForAuthenticatedUser(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const packagesListPackagesForAuthenticatedUserQuerySchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - visibility: z.enum(["public", "private", "internal"]).optional(), + const migrationsGetStatusForAuthenticatedUserQuerySchema = z.object({ + exclude: z.array(z.coerce.string()).optional(), }) router.get( - "packagesListPackagesForAuthenticatedUser", - "/user/packages", + "migrationsGetStatusForAuthenticatedUser", + "/user/migrations/:migrationId", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + migrationsGetStatusForAuthenticatedUserParamSchema, + ctx.params + ), query: parseRequestInput( - packagesListPackagesForAuthenticatedUserQuerySchema, + migrationsGetStatusForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.packagesListPackagesForAuthenticatedUser( - input, - ctx - ) + await implementation.migrationsGetStatusForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -108690,7 +114137,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), + git_url: z.coerce.string(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -108702,7 +114149,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), + ssh_url: z.coerce.string(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -108710,130 +114157,301 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), + id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) .optional(), - secret_scanning: z + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - .optional(), + ), + url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetArchiveForAuthenticatedUserParamSchema = z.object({ + migration_id: z.coerce.number(), + }) + + router.get( + "migrationsGetArchiveForAuthenticatedUser", + "/user/migrations/:migrationId/archive", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsGetArchiveForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.migrationsGetArchiveForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["302", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const packagesGetPackageForAuthenticatedUserParamSchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), + const migrationsDeleteArchiveForAuthenticatedUserParamSchema = z.object({ + migration_id: z.coerce.number(), }) - router.get( - "packagesGetPackageForAuthenticatedUser", - "/user/packages/:packageType/:packageName", + router.delete( + "migrationsDeleteArchiveForAuthenticatedUser", + "/user/migrations/:migrationId/archive", async (ctx, next) => { const input = { params: parseRequestInput( - packagesGetPackageForAuthenticatedUserParamSchema, + migrationsDeleteArchiveForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -108841,52 +114459,147 @@ export function bootstrap( } const { status, body } = - await implementation.packagesGetPackageForAuthenticatedUser(input, ctx) + await implementation.migrationsDeleteArchiveForAuthenticatedUser( + input, + ctx + ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsUnlockRepoForAuthenticatedUserParamSchema = z.object({ + migration_id: z.coerce.number(), + repo_name: z.coerce.string(), + }) + + router.delete( + "migrationsUnlockRepoForAuthenticatedUser", + "/user/migrations/:migrationId/repos/:repoName/lock", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsUnlockRepoForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.migrationsUnlockRepoForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsListReposForAuthenticatedUserParamSchema = z.object({ + migration_id: z.coerce.number(), + }) + + const migrationsListReposForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "migrationsListReposForAuthenticatedUser", + "/user/migrations/:migrationId/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsListReposForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + migrationsListReposForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.migrationsListReposForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), @@ -109048,13 +114761,590 @@ export function bootstrap( }) .optional(), }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) + ), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsListForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "orgsListForAuthenticatedUser", + "/user/orgs", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + orgsListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.orgsListForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const packagesListPackagesForAuthenticatedUserQuerySchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + visibility: z.enum(["public", "private", "internal"]).optional(), + }) + + router.get( + "packagesListPackagesForAuthenticatedUser", + "/user/packages", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + packagesListPackagesForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.packagesListPackagesForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const packagesGetPackageForAuthenticatedUserParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + }) + + router.get( + "packagesGetPackageForAuthenticatedUser", + "/user/packages/:packageType/:packageName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesGetPackageForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } + const { status, body } = + await implementation.packagesGetPackageForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109091,35 +115381,39 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109163,35 +115457,39 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109239,73 +115537,76 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ), + ], + [ + "401", z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109343,41 +115644,47 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce.string().datetime({ offset: true }).optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109415,35 +115722,39 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109483,35 +115794,39 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109530,86 +115845,90 @@ export function bootstrap( params: undefined, query: undefined, body: parseRequestInput( - projectsCreateForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.projectsCreateForAuthenticatedUser(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + projectsCreateForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.projectsCreateForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } - + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109639,46 +115958,50 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + [ + "401", z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -109706,15 +116029,418 @@ export function bootstrap( reposListForAuthenticatedUserQuerySchema, ctx.query ), - body: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposListForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateForAuthenticatedUserBodySchema = z.object({ + name: z.coerce.string(), + description: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + team_id: z.coerce.number().optional(), + auto_init: z.coerce.boolean().optional(), + gitignore_template: z.coerce.string().optional(), + license_template: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + has_downloads: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateForAuthenticatedUser", + "/user/repos", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + reposCreateForAuthenticatedUserBodySchema, + ctx.body + ), } const { status, body } = - await implementation.reposListForAuthenticatedUser(input, ctx) + await implementation.reposCreateForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "201", z.object({ id: z.coerce.number(), node_id: z.coerce.string(), @@ -110011,466 +116737,73 @@ export function bootstrap( master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const reposCreateForAuthenticatedUserBodySchema = z.object({ - name: z.coerce.string(), - description: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - team_id: z.coerce.number().optional(), - auto_init: z.coerce.boolean().optional(), - gitignore_template: z.coerce.string().optional(), - license_template: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), - has_downloads: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateForAuthenticatedUser", - "/user/repos", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - reposCreateForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposCreateForAuthenticatedUser(input, ctx) - - if (status === 201) { - ctx.body = z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ], + ["304", z.void()], + [ + "400", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .parse(body) - } else if (status === 400) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -110500,17 +116833,176 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - repository: z.object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -110533,230 +117025,75 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -110785,35 +117122,40 @@ export function bootstrap( ctx ) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -110842,35 +117184,40 @@ export function bootstrap( ctx ) - if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 409) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -110900,46 +117247,50 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + [ + "401", z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -110959,77 +117310,81 @@ export function bootstrap( query: undefined, body: parseRequestInput( usersCreateSshSigningKeyForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.usersCreateSshSigningKeyForAuthenticatedUser( - input, - ctx - ) - - if (status === 201) { - ctx.body = z - .object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) + ctx.body + ), } + const { status, body } = + await implementation.usersCreateSshSigningKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "201", + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111058,44 +117413,48 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111124,35 +117483,40 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111184,26 +117548,62 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - starred_at: z.coerce.string().datetime({ offset: true }), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + starred_at: z.coerce.string().datetime({ offset: true }), + repo: z.object({ + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -111225,292 +117625,260 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111540,35 +117908,40 @@ export function bootstrap( ctx ) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111595,35 +117968,40 @@ export function bootstrap( const { status, body } = await implementation.activityStarRepoForAuthenticatedUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111650,35 +118028,40 @@ export function bootstrap( const { status, body } = await implementation.activityUnstarRepoForAuthenticatedUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111708,193 +118091,197 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ["304", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -111921,133 +118308,143 @@ export function bootstrap( const { status, body } = await implementation.teamsListForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), }) .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - ) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce + .boolean() + .optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce + .string() + .optional(), + members_can_create_public_repositories: z.coerce + .boolean() + .optional(), + members_can_create_private_repositories: z.coerce + .boolean() + .optional(), + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce + .boolean() + .optional(), + members_can_create_private_pages: z.coerce + .boolean() + .optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -112067,36 +118464,40 @@ export function bootstrap( const { status, body } = await implementation.usersList(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -112114,127 +118515,130 @@ export function bootstrap( const { status, body } = await implementation.usersGetByUsername(input, ctx) - if (status === 200) { - ctx.body = z - .union([ - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - private_gists: z.coerce.number(), - total_private_repos: z.coerce.number(), - owned_private_repos: z.coerce.number(), - disk_usage: z.coerce.number(), - collaborators: z.coerce.number(), - two_factor_authentication: z.coerce.boolean(), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - business_plus: z.coerce.boolean().optional(), - ldap_dn: z.coerce.string().optional(), - }), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.union([ + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), + }), + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }), + ]), + ], + [ + "404", z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), }), - ]) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -112267,152 +118671,57 @@ export function bootstrap( const { status, body } = await implementation.activityListEventsForAuthenticatedUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ id: z.coerce.number(), - node_id: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -112435,34 +118744,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -112484,330 +118780,45 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -112830,108 +118841,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -112953,251 +118894,423 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const activityListOrgEventsForAuthenticatedUserParamSchema = z.object({ - username: z.coerce.string(), - org: z.coerce.string(), - }) - - const activityListOrgEventsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListOrgEventsForAuthenticatedUser", - "/users/:username/events/orgs/:org", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListOrgEventsForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListOrgEventsForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListOrgEventsForAuthenticatedUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + .optional(), + }) + .optional(), + comment: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -113220,76 +119333,25 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -113311,288 +119373,254 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const activityListOrgEventsForAuthenticatedUserParamSchema = z.object({ + username: z.coerce.string(), + org: z.coerce.string(), + }) + + const activityListOrgEventsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "activityListOrgEventsForAuthenticatedUser", + "/users/:username/events/orgs/:org", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListOrgEventsForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListOrgEventsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListOrgEventsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -113615,108 +119643,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -113738,68 +119696,548 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -113833,152 +120271,57 @@ export function bootstrap( const { status, body } = await implementation.activityListPublicEventsForUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ id: z.coerce.number(), - node_id: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -114001,34 +120344,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -114050,27 +120380,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -114089,291 +120402,23 @@ export function bootstrap( repos_url: z.coerce.string(), events_url: z.coerce.string(), received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -114396,108 +120441,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -114519,68 +120494,548 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -114591,61 +121046,64 @@ export function bootstrap( }) const usersListFollowersForUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "usersListFollowersForUser", - "/users/:username/followers", - async (ctx, next) => { - const input = { - params: parseRequestInput( - usersListFollowersForUserParamSchema, - ctx.params - ), - query: parseRequestInput( - usersListFollowersForUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.usersListFollowersForUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "usersListFollowersForUser", + "/users/:username/followers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + usersListFollowersForUserParamSchema, + ctx.params + ), + query: parseRequestInput( + usersListFollowersForUserQuerySchema, + ctx.query + ), + body: undefined, } + const { status, body } = await implementation.usersListFollowersForUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -114681,36 +121139,39 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -114739,6 +121200,13 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -114764,50 +121232,27 @@ export function bootstrap( const { status, body } = await implementation.gistsListForUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -114829,39 +121274,65 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -114894,52 +121365,55 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -114974,51 +121448,54 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - contexts: z.array( - z.object({ - message: z.coerce.string(), - octicon: z.coerce.string(), - }) - ), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + contexts: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + message: z.coerce.string(), + octicon: z.coerce.string(), }) - ) - .optional(), - }) - .parse(body) - } - + ), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -115046,99 +121523,106 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z.enum(["read", "write"]).optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z.enum(["read", "write"]).optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -115174,54 +121658,62 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array(z.object({ id: z.coerce.number(), key: z.coerce.string() })) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), key: z.coerce.string() }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } - ) - - const orgsListForUserParamSchema = z.object({ username: z.coerce.string() }) - - const orgsListForUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("orgsListForUser", "/users/:username/orgs", async (ctx, next) => { - const input = { - params: parseRequestInput(orgsListForUserParamSchema, ctx.params), - query: parseRequestInput(orgsListForUserQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.orgsListForUser(input, ctx) - - if (status === 200) { - ctx.body = z - .array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }) - ) - .parse(body) + ) + + const orgsListForUserParamSchema = z.object({ username: z.coerce.string() }) + + const orgsListForUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("orgsListForUser", "/users/:username/orgs", async (ctx, next) => { + const input = { + params: parseRequestInput(orgsListForUserParamSchema, ctx.params), + query: parseRequestInput(orgsListForUserQuerySchema, ctx.query), + body: undefined, } + const { status, body } = await implementation.orgsListForUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -115263,9 +121755,281 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const packagesGetPackageForUserParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + username: z.coerce.string(), + }) + + router.get( + "packagesGetPackageForUser", + "/users/:username/packages/:packageType/:packageName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesGetPackageForUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.packagesGetPackageForUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", z.object({ id: z.coerce.number(), name: z.coerce.string(), @@ -115472,277 +122236,11 @@ export function bootstrap( .optional(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - - ctx.status = status - return next() - } - ) - - const packagesGetPackageForUserParamSchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), - username: z.coerce.string(), - }) - - router.get( - "packagesGetPackageForUser", - "/users/:username/packages/:packageType/:packageName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - packagesGetPackageForUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.packagesGetPackageForUser( - input, - ctx - ) - - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -115777,35 +122275,39 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageForUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -115847,35 +122349,39 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageForUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -115914,73 +122420,76 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ), + ], + [ + "401", z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } else if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -116016,41 +122525,47 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageVersionForUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce.string().datetime({ offset: true }).optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -116086,35 +122601,39 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageVersionForUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -116150,35 +122669,39 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageVersionForUser(input, ctx) - if (status === 401) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 403) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "401", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -116209,77 +122732,80 @@ export function bootstrap( ctx ) - if (status === 200) { - ctx.body = z - .array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + [ + "422", + z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) .optional(), - private: z.coerce.boolean().optional(), - }) - ) - .parse(body) - } else if (status === 422) { - ctx.body = z - .object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }) - .parse(body) - } - + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -116313,152 +122839,57 @@ export function bootstrap( const { status, body } = await implementation.activityListReceivedEventsForUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -116481,503 +122912,81 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -117000,67 +123009,601 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -117094,152 +123637,57 @@ export function bootstrap( const { status, body } = await implementation.activityListReceivedPublicEventsForUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z .object({ id: z.coerce.number(), - node_id: z.coerce.string(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), number: z.coerce.number(), - state: z.enum(["open", "closed"]), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -117262,34 +123710,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -117311,27 +123746,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -117354,18 +123772,19 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -117388,253 +123807,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -117656,192 +123860,548 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -117869,175 +124429,178 @@ export function bootstrap( const { status, body } = await implementation.reposListForUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -118063,33 +124626,36 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubActionsBillingUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_minutes_used: z.coerce.number(), - total_paid_minutes_used: z.coerce.number(), - included_minutes: z.coerce.number(), - minutes_used_breakdown: z.object({ - UBUNTU: z.coerce.number().optional(), - MACOS: z.coerce.number().optional(), - WINDOWS: z.coerce.number().optional(), - ubuntu_4_core: z.coerce.number().optional(), - ubuntu_8_core: z.coerce.number().optional(), - ubuntu_16_core: z.coerce.number().optional(), - ubuntu_32_core: z.coerce.number().optional(), - ubuntu_64_core: z.coerce.number().optional(), - windows_4_core: z.coerce.number().optional(), - windows_8_core: z.coerce.number().optional(), - windows_16_core: z.coerce.number().optional(), - windows_32_core: z.coerce.number().optional(), - windows_64_core: z.coerce.number().optional(), - macos_12_core: z.coerce.number().optional(), - total: z.coerce.number().optional(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_minutes_used: z.coerce.number(), + total_paid_minutes_used: z.coerce.number(), + included_minutes: z.coerce.number(), + minutes_used_breakdown: z.object({ + UBUNTU: z.coerce.number().optional(), + MACOS: z.coerce.number().optional(), + WINDOWS: z.coerce.number().optional(), + ubuntu_4_core: z.coerce.number().optional(), + ubuntu_8_core: z.coerce.number().optional(), + ubuntu_16_core: z.coerce.number().optional(), + ubuntu_32_core: z.coerce.number().optional(), + ubuntu_64_core: z.coerce.number().optional(), + windows_4_core: z.coerce.number().optional(), + windows_8_core: z.coerce.number().optional(), + windows_16_core: z.coerce.number().optional(), + windows_32_core: z.coerce.number().optional(), + windows_64_core: z.coerce.number().optional(), + macos_12_core: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }), }), - }) - .parse(body) - } - + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -118115,16 +124681,19 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubPackagesBillingUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - total_gigabytes_bandwidth_used: z.coerce.number(), - total_paid_gigabytes_bandwidth_used: z.coerce.number(), - included_gigabytes_bandwidth: z.coerce.number(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_gigabytes_bandwidth_used: z.coerce.number(), + total_paid_gigabytes_bandwidth_used: z.coerce.number(), + included_gigabytes_bandwidth: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -118150,16 +124719,19 @@ export function bootstrap( const { status, body } = await implementation.billingGetSharedStorageBillingUser(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - days_left_in_billing_cycle: z.coerce.number(), - estimated_paid_storage_for_month: z.coerce.number(), - estimated_storage_for_month: z.coerce.number(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + days_left_in_billing_cycle: z.coerce.number(), + estimated_paid_storage_for_month: z.coerce.number(), + estimated_storage_for_month: z.coerce.number(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -118193,19 +124765,22 @@ export function bootstrap( const { status, body } = await implementation.usersListSshSigningKeysForUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -118241,10 +124816,10 @@ export function bootstrap( const { status, body } = await implementation.activityListReposStarredByUser(input, ctx) - if (status === 200) { - ctx.body = z.object({}).parse(body) - } - + ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -118278,175 +124853,178 @@ export function bootstrap( const { status, body } = await implementation.activityListReposWatchedByUser(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ) - .parse(body) - } - + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() } @@ -118461,19 +125039,21 @@ export function bootstrap( const { status, body } = await implementation.metaGetAllVersions(input, ctx) - if (status === 200) { - ctx.body = z.array(z.coerce.string()).parse(body) - } else if (status === 404) { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + [ + "404", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -118487,10 +125067,10 @@ export function bootstrap( const { status, body } = await implementation.metaGetZen(input, ctx) - if (status === 200) { - ctx.body = z.coerce.string().parse(body) - } - + ctx.body = responseValidationFactory( + [["200", z.coerce.string()]], + undefined + )(status, body) ctx.status = status return next() }) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/models.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/models.ts index e98f5c01c..812a729a3 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/models.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/models.ts @@ -2,16 +2,150 @@ /* tslint:disable */ /* eslint:disable */ +export type t_actions_billing_usage = { + included_minutes: number + minutes_used_breakdown: { + MACOS?: number + UBUNTU?: number + WINDOWS?: number + macos_12_core?: number + total?: number + ubuntu_16_core?: number + ubuntu_32_core?: number + ubuntu_4_core?: number + ubuntu_64_core?: number + ubuntu_8_core?: number + windows_16_core?: number + windows_32_core?: number + windows_4_core?: number + windows_64_core?: number + windows_8_core?: number + } + total_minutes_used: number + total_paid_minutes_used: number +} + +export type t_actions_cache_list = { + actions_caches: { + created_at?: string + id?: number + key?: string + last_accessed_at?: string + ref?: string + size_in_bytes?: number + version?: string + }[] + total_count: number +} + +export type t_actions_cache_usage_by_repository = { + active_caches_count: number + active_caches_size_in_bytes: number + full_name: string +} + +export type t_actions_cache_usage_org_enterprise = { + total_active_caches_count: number + total_active_caches_size_in_bytes: number +} + export type t_actions_can_approve_pull_request_reviews = boolean export type t_actions_default_workflow_permissions = "read" | "write" export type t_actions_enabled = boolean +export type t_actions_get_default_workflow_permissions = { + can_approve_pull_request_reviews: t_actions_can_approve_pull_request_reviews + default_workflow_permissions: t_actions_default_workflow_permissions +} + +export type t_actions_organization_permissions = { + allowed_actions?: t_allowed_actions + enabled_repositories: t_enabled_repositories + selected_actions_url?: t_selected_actions_url + selected_repositories_url?: string +} + +export type t_actions_public_key = { + created_at?: string + id?: number + key: string + key_id: string + title?: string + url?: string +} + +export type t_actions_repository_permissions = { + allowed_actions?: t_allowed_actions + enabled: t_actions_enabled + selected_actions_url?: t_selected_actions_url +} + +export type t_actions_secret = { + created_at: string + name: string + updated_at: string +} + +export type t_actions_variable = { + created_at: string + name: string + updated_at: string + value: string +} + +export type t_actions_workflow_access_to_repository = { + access_level: "none" | "user" | "organization" | "enterprise" +} + +export type t_actor = { + avatar_url: string + display_login?: string + gravatar_id: string | null + id: number + login: string + url: string +} + +export type t_alert_created_at = string + +export type t_alert_dismissed_at = string + +export type t_alert_fixed_at = string + +export type t_alert_html_url = string + +export type t_alert_instances_url = string + export type t_alert_number = number +export type t_alert_updated_at = string + +export type t_alert_url = string + export type t_allowed_actions = "all" | "local_only" | "selected" +export type t_api_overview = { + actions?: string[] + api?: string[] + dependabot?: string[] + git?: string[] + hooks?: string[] + importer?: string[] + packages?: string[] + pages?: string[] + ssh_key_fingerprints?: { + SHA256_DSA?: string + SHA256_ECDSA?: string + SHA256_ED25519?: string + SHA256_RSA?: string + } + ssh_keys?: string[] + verifiable_password_authentication: boolean + web?: string[] +} + export type t_app_permissions = { actions?: "read" | "write" administration?: "read" | "write" @@ -48,6 +182,411 @@ export type t_app_permissions = { workflows?: "write" } +export type t_artifact = { + archive_download_url: string + created_at: string | null + expired: boolean + expires_at: string | null + id: number + name: string + node_id: string + size_in_bytes: number + updated_at: string | null + url: string + workflow_run?: { + head_branch?: string + head_repository_id?: number + head_sha?: string + id?: number + repository_id?: number + } | null +} + +export type t_authentication_token = { + expires_at: string + permissions?: { + [key: string]: unknown + } + repositories?: t_repository[] + repository_selection?: "all" | "selected" + single_file?: string | null + token: string +} + +export type t_author_association = + | "COLLABORATOR" + | "CONTRIBUTOR" + | "FIRST_TIMER" + | "FIRST_TIME_CONTRIBUTOR" + | "MANNEQUIN" + | "MEMBER" + | "NONE" + | "OWNER" + +export type t_authorization = { + app: { + client_id: string + name: string + url: string + } + created_at: string + expires_at: string | null + fingerprint: string | null + hashed_token: string | null + id: number + installation?: t_nullable_scoped_installation + note: string | null + note_url: string | null + scopes: string[] | null + token: string + token_last_eight: string | null + updated_at: string + url: string + user?: t_nullable_simple_user +} + +export type t_auto_merge = { + commit_message: string + commit_title: string + enabled_by: t_simple_user + merge_method: "merge" | "squash" | "rebase" +} + +export type t_autolink = { + id: number + is_alphanumeric: boolean + key_prefix: string + url_template: string +} + +export type t_base_gist = { + comments: number + comments_url: string + commits_url: string + created_at: string + description: string | null + files: { + [key: string]: unknown + } + forks?: { + [key: string]: unknown + }[] + forks_url: string + git_pull_url: string + git_push_url: string + history?: { + [key: string]: unknown + }[] + html_url: string + id: string + node_id: string + owner?: t_simple_user + public: boolean + truncated?: boolean + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_basic_error = { + documentation_url?: string + message?: string + status?: string + url?: string +} + +export type t_blob = { + content: string + encoding: string + highlighted_content?: string + node_id: string + sha: string + size: number | null + url: string +} + +export type t_branch_protection = { + allow_deletions?: { + enabled?: boolean + } + allow_force_pushes?: { + enabled?: boolean + } + allow_fork_syncing?: { + enabled?: boolean + } + block_creations?: { + enabled?: boolean + } + enabled?: boolean + enforce_admins?: t_protected_branch_admin_enforced + lock_branch?: { + enabled?: boolean + } + name?: string + protection_url?: string + required_conversation_resolution?: { + enabled?: boolean + } + required_linear_history?: { + enabled?: boolean + } + required_pull_request_reviews?: t_protected_branch_pull_request_review + required_signatures?: { + enabled: boolean + url: string + } + required_status_checks?: t_protected_branch_required_status_check + restrictions?: t_branch_restriction_policy + url?: string +} + +export type t_branch_restriction_policy = { + apps: { + created_at?: string + description?: string + events?: string[] + external_url?: string + html_url?: string + id?: number + name?: string + node_id?: string + owner?: { + avatar_url?: string + description?: string + events_url?: string + followers_url?: string + following_url?: string + gists_url?: string + gravatar_id?: string + hooks_url?: string + html_url?: string + id?: number + issues_url?: string + login?: string + members_url?: string + node_id?: string + organizations_url?: string + public_members_url?: string + received_events_url?: string + repos_url?: string + site_admin?: boolean + starred_url?: string + subscriptions_url?: string + type?: string + url?: string + } + permissions?: { + contents?: string + issues?: string + metadata?: string + single_file?: string + } + slug?: string + updated_at?: string + }[] + apps_url: string + teams: { + description?: string | null + html_url?: string + id?: number + members_url?: string + name?: string + node_id?: string + parent?: string | null + permission?: string + privacy?: string + repositories_url?: string + slug?: string + url?: string + }[] + teams_url: string + url: string + users: { + 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 + }[] + users_url: string +} + +export type t_branch_short = { + commit: { + sha: string + url: string + } + name: string + protected: boolean +} + +export type t_branch_with_protection = { + _links: { + html: string + self: string + } + commit: t_commit + name: string + pattern?: string + protected: boolean + protection: t_branch_protection + protection_url: string + required_approving_review_count?: number +} + +export type t_check_annotation = { + annotation_level: string | null + blob_href: string + end_column: number | null + end_line: number + message: string | null + path: string + raw_details: string | null + start_column: number | null + start_line: number + title: string | null +} + +export type t_check_run = { + app: t_nullable_integration + check_suite: { + id: number + } | null + completed_at: string | null + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | null + deployment?: t_deployment_simple + details_url: string | null + external_id: string | null + head_sha: string + html_url: string | null + id: number + name: string + node_id: string + output: { + annotations_count: number + annotations_url: string + summary: string | null + text: string | null + title: string | null + } + pull_requests: t_pull_request_minimal[] + started_at: string | null + status: "queued" | "in_progress" | "completed" + url: string +} + +export type t_check_suite = { + after: string | null + app: t_nullable_integration + before: string | null + check_runs_url: string + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | "startup_failure" + | "stale" + | "null" + | null + created_at: string | null + head_branch: string | null + head_commit: t_simple_commit + head_sha: string + id: number + latest_check_runs_count: number + node_id: string + pull_requests: t_pull_request_minimal[] | null + repository: t_minimal_repository + rerequestable?: boolean + runs_rerequestable?: boolean + status: "queued" | "in_progress" | "completed" | null + updated_at: string | null + url: string | null +} + +export type t_check_suite_preference = { + preferences: { + auto_trigger_checks?: { + app_id: number + setting: boolean + }[] + } + repository: t_minimal_repository +} + +export type t_clone_traffic = { + clones: t_traffic[] + count: number + uniques: number +} + +export type t_code_frequency_stat = number[] + +export type t_code_of_conduct = { + body?: string + html_url: string | null + key: string + name: string + url: string +} + +export type t_code_of_conduct_simple = { + html_url: string | null + key: string + name: string + url: string +} + +export type t_code_scanning_alert = { + created_at: t_alert_created_at + dismissed_at: t_alert_dismissed_at + dismissed_by: t_nullable_simple_user + dismissed_comment?: t_code_scanning_alert_dismissed_comment + dismissed_reason: t_code_scanning_alert_dismissed_reason + fixed_at?: t_alert_fixed_at + html_url: t_alert_html_url + instances_url: t_alert_instances_url + most_recent_instance: t_code_scanning_alert_instance + number: t_alert_number + rule: t_code_scanning_alert_rule + state: t_code_scanning_alert_state + tool: t_code_scanning_analysis_tool + updated_at?: t_alert_updated_at + url: t_alert_url +} + +export type t_code_scanning_alert_classification = + | "source" + | "generated" + | "test" + | "library" + export type t_code_scanning_alert_dismissed_comment = string export type t_code_scanning_alert_dismissed_reason = @@ -56,6 +595,69 @@ export type t_code_scanning_alert_dismissed_reason = | "won't fix" | "used in tests" +export type t_code_scanning_alert_environment = string + +export type t_code_scanning_alert_instance = { + analysis_key?: t_code_scanning_analysis_analysis_key + category?: t_code_scanning_analysis_category + classifications?: t_code_scanning_alert_classification[] + commit_sha?: string + environment?: t_code_scanning_alert_environment + html_url?: string + location?: t_code_scanning_alert_location + message?: { + text?: string + } + ref?: t_code_scanning_ref + state?: t_code_scanning_alert_state +} + +export type t_code_scanning_alert_items = { + created_at: t_alert_created_at + dismissed_at: t_alert_dismissed_at + dismissed_by: t_nullable_simple_user + dismissed_comment?: t_code_scanning_alert_dismissed_comment + dismissed_reason: t_code_scanning_alert_dismissed_reason + fixed_at?: t_alert_fixed_at + html_url: t_alert_html_url + instances_url: t_alert_instances_url + most_recent_instance: t_code_scanning_alert_instance + number: t_alert_number + rule: t_code_scanning_alert_rule_summary + state: t_code_scanning_alert_state + tool: t_code_scanning_analysis_tool + updated_at?: t_alert_updated_at + url: t_alert_url +} + +export type t_code_scanning_alert_location = { + end_column?: number + end_line?: number + path?: string + start_column?: number + start_line?: number +} + +export type t_code_scanning_alert_rule = { + description?: string + full_description?: string + help?: string | null + help_uri?: string | null + id?: string | null + name?: string + security_severity_level?: "low" | "medium" | "high" | "critical" | null + severity?: "none" | "note" | "warning" | "error" | null + tags?: string[] | null +} + +export type t_code_scanning_alert_rule_summary = { + description?: string + id?: string | null + name?: string + severity?: "none" | "note" | "warning" | "error" | null + tags?: string[] | null +} + export type t_code_scanning_alert_set_state = "open" | "dismissed" export type t_code_scanning_alert_severity = @@ -73,63 +675,5190 @@ export type t_code_scanning_alert_state = | "dismissed" | "fixed" +export type t_code_scanning_analysis = { + analysis_key: t_code_scanning_analysis_analysis_key + category?: t_code_scanning_analysis_category + commit_sha: t_code_scanning_analysis_commit_sha + created_at: t_code_scanning_analysis_created_at + deletable: boolean + environment: t_code_scanning_analysis_environment + error: string + id: number + ref: t_code_scanning_ref + results_count: number + rules_count: number + sarif_id: t_code_scanning_analysis_sarif_id + tool: t_code_scanning_analysis_tool + url: t_code_scanning_analysis_url + warning: string +} + +export type t_code_scanning_analysis_analysis_key = string + +export type t_code_scanning_analysis_category = string + export type t_code_scanning_analysis_commit_sha = string +export type t_code_scanning_analysis_created_at = string + +export type t_code_scanning_analysis_deletion = { + readonly confirm_delete_url: string | null + readonly next_analysis_url: string | null +} + +export type t_code_scanning_analysis_environment = string + export type t_code_scanning_analysis_sarif_file = string export type t_code_scanning_analysis_sarif_id = string +export type t_code_scanning_analysis_tool = { + guid?: t_code_scanning_analysis_tool_guid + name?: t_code_scanning_analysis_tool_name + version?: t_code_scanning_analysis_tool_version +} + export type t_code_scanning_analysis_tool_guid = string export type t_code_scanning_analysis_tool_name = string -export type t_code_scanning_ref = string +export type t_code_scanning_analysis_tool_version = string -export type t_deployment_branch_policy_settings = { - custom_branch_policies: boolean - protected_branches: boolean +export type t_code_scanning_analysis_url = string + +export type t_code_scanning_codeql_database = { + content_type: string + created_at: string + id: number + language: string + name: string + size: number + updated_at: string + uploader: t_simple_user + url: string } -export type t_deployment_reviewer_type = "User" | "Team" +export type t_code_scanning_organization_alert_items = { + created_at: t_alert_created_at + dismissed_at: t_alert_dismissed_at + dismissed_by: t_nullable_simple_user + dismissed_comment?: t_code_scanning_alert_dismissed_comment + dismissed_reason: t_code_scanning_alert_dismissed_reason + fixed_at?: t_alert_fixed_at + html_url: t_alert_html_url + instances_url: t_alert_instances_url + most_recent_instance: t_code_scanning_alert_instance + number: t_alert_number + repository: t_simple_repository + rule: t_code_scanning_alert_rule + state: t_code_scanning_alert_state + tool: t_code_scanning_analysis_tool + updated_at?: t_alert_updated_at + url: t_alert_url +} -export type t_enabled_repositories = "all" | "none" | "selected" +export type t_code_scanning_ref = string -export type t_interaction_expiry = - | "one_day" - | "three_days" - | "one_week" - | "one_month" - | "six_months" +export type t_code_scanning_sarifs_receipt = { + id?: t_code_scanning_analysis_sarif_id + readonly url?: string +} -export type t_interaction_group = - | "existing_users" - | "contributors_only" - | "collaborators_only" +export type t_code_scanning_sarifs_status = { + readonly analyses_url?: string | null + readonly errors?: string[] | null + processing_status?: "pending" | "complete" | "failed" +} -export type t_metadata = { - [key: string]: unknown +export type t_code_search_result_item = { + file_size?: number + git_url: string + html_url: string + language?: string | null + last_modified_at?: string + line_numbers?: string[] + name: string + path: string + repository: t_minimal_repository + score: number + sha: string + text_matches?: t_search_result_text_matches + url: string } -export type t_secret_scanning_alert_resolution = - | "null" - | "false_positive" - | "wont_fix" - | "revoked" - | "used_in_tests" +export type t_codeowners_errors = { + errors: { + column: number + kind: string + line: number + message: string + path: string + source?: string + suggestion?: string | null + }[] +} -export type t_secret_scanning_alert_resolution_comment = string +export type t_codespace = { + billable_owner: t_simple_user + created_at: string + devcontainer_path?: string | null + display_name?: string | null + environment_id: string | null + git_status: { + ahead?: number + behind?: number + has_uncommitted_changes?: boolean + has_unpushed_changes?: boolean + ref?: string + } + id: number + idle_timeout_minutes: number | null + idle_timeout_notice?: string | null + last_known_stop_notice?: string | null + last_used_at: string + location: "EastUs" | "SouthEastAsia" | "WestEurope" | "WestUs2" + machine: t_nullable_codespace_machine + machines_url: string + name: string + owner: t_simple_user + pending_operation?: boolean | null + pending_operation_disabled_reason?: string | null + prebuild: boolean | null + publish_url?: string | null + pulls_url: string | null + recent_folders: string[] + repository: t_minimal_repository + retention_expires_at?: string | null + retention_period_minutes?: number | null + runtime_constraints?: { + allowed_port_privacy_settings?: string[] | null + } + start_url: string + state: + | "Unknown" + | "Created" + | "Queued" + | "Provisioning" + | "Available" + | "Awaiting" + | "Unavailable" + | "Deleted" + | "Moved" + | "Shutdown" + | "Archived" + | "Starting" + | "ShuttingDown" + | "Failed" + | "Exporting" + | "Updating" + | "Rebuilding" + stop_url: string + updated_at: string + url: string + web_url: string +} + +export type t_codespace_export_details = { + branch?: string | null + completed_at?: string | null + export_url?: string + html_url?: string | null + id?: string + sha?: string | null + state?: string | null +} + +export type t_codespace_machine = { + cpus: number + display_name: string + memory_in_bytes: number + name: string + operating_system: string + prebuild_availability: "none" | "ready" | "in_progress" | null + storage_in_bytes: number +} + +export type t_codespace_with_full_repository = { + billable_owner: t_simple_user + created_at: string + devcontainer_path?: string | null + display_name?: string | null + environment_id: string | null + git_status: { + ahead?: number + behind?: number + has_uncommitted_changes?: boolean + has_unpushed_changes?: boolean + ref?: string + } + id: number + idle_timeout_minutes: number | null + idle_timeout_notice?: string | null + last_used_at: string + location: "EastUs" | "SouthEastAsia" | "WestEurope" | "WestUs2" + machine: t_nullable_codespace_machine + machines_url: string + name: string + owner: t_simple_user + pending_operation?: boolean | null + pending_operation_disabled_reason?: string | null + prebuild: boolean | null + publish_url?: string | null + pulls_url: string | null + recent_folders: string[] + repository: t_full_repository + retention_expires_at?: string | null + retention_period_minutes?: number | null + runtime_constraints?: { + allowed_port_privacy_settings?: string[] | null + } + start_url: string + state: + | "Unknown" + | "Created" + | "Queued" + | "Provisioning" + | "Available" + | "Awaiting" + | "Unavailable" + | "Deleted" + | "Moved" + | "Shutdown" + | "Archived" + | "Starting" + | "ShuttingDown" + | "Failed" + | "Exporting" + | "Updating" + | "Rebuilding" + stop_url: string + updated_at: string + url: string + web_url: string +} + +export type t_codespaces_org_secret = { + created_at: string + name: string + selected_repositories_url?: string + updated_at: string + visibility: "all" | "private" | "selected" +} -export type t_secret_scanning_alert_state = "open" | "resolved" +export type t_codespaces_public_key = { + created_at?: string + id?: number + key: string + key_id: string + title?: string + url?: string +} -export type t_wait_timer = number +export type t_codespaces_secret = { + created_at: string + name: string + selected_repositories_url: string + updated_at: string + visibility: "all" | "private" | "selected" +} -export type t_webhook_config_content_type = string +export type t_codespaces_user_public_key = { + key: string + key_id: string +} -export type t_webhook_config_insecure_ssl = string | number +export type t_collaborator = { + avatar_url: string + email?: string | null + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + html_url: string + id: number + login: string + name?: string | null + node_id: string + organizations_url: string + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + received_events_url: string + repos_url: string + role_name: string + site_admin: boolean + starred_url: string + subscriptions_url: string + type: string + url: string +} -export type t_webhook_config_secret = string +export type t_combined_billing_usage = { + days_left_in_billing_cycle: number + estimated_paid_storage_for_month: number + estimated_storage_for_month: number +} -export type t_webhook_config_url = string +export type t_combined_commit_status = { + commit_url: string + repository: t_minimal_repository + sha: string + state: string + statuses: t_simple_commit_status[] + total_count: number + url: string +} + +export type t_commit = { + author: t_nullable_simple_user + comments_url: string + commit: { + author: t_nullable_git_user + comment_count: number + committer: t_nullable_git_user + message: string + tree: { + sha: string + url: string + } + url: string + verification?: t_verification + } + committer: t_nullable_simple_user + files?: t_diff_entry[] + html_url: string + node_id: string + parents: { + html_url?: string + sha: string + url: string + }[] + sha: string + stats?: { + additions?: number + deletions?: number + total?: number + } + url: string +} + +export type t_commit_activity = { + days: number[] + total: number + week: number +} + +export type t_commit_comment = { + author_association: t_author_association + body: string + commit_id: string + created_at: string + html_url: string + id: number + line: number | null + node_id: string + path: string | null + position: number | null + reactions?: t_reaction_rollup + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_commit_comparison = { + ahead_by: number + base_commit: t_commit + behind_by: number + commits: t_commit[] + diff_url: string + files?: t_diff_entry[] + html_url: string + merge_base_commit: t_commit + patch_url: string + permalink_url: string + status: "diverged" | "ahead" | "behind" | "identical" + total_commits: number + url: string +} + +export type t_commit_search_result_item = { + author: t_nullable_simple_user + comments_url: string + commit: { + author: { + date: string + email: string + name: string + } + comment_count: number + committer: t_nullable_git_user + message: string + tree: { + sha: string + url: string + } + url: string + verification?: t_verification + } + committer: t_nullable_git_user + html_url: string + node_id: string + parents: { + html_url?: string + sha?: string + url?: string + }[] + repository: t_minimal_repository + score: number + sha: string + text_matches?: t_search_result_text_matches + url: string +} + +export type t_community_profile = { + content_reports_enabled?: boolean + description: string | null + documentation: string | null + files: { + code_of_conduct: t_nullable_code_of_conduct_simple + code_of_conduct_file: t_nullable_community_health_file + contributing: t_nullable_community_health_file + issue_template: t_nullable_community_health_file + license: t_nullable_license_simple + pull_request_template: t_nullable_community_health_file + readme: t_nullable_community_health_file + } + health_percentage: number + updated_at: string | null +} + +export type t_content_directory = { + _links: { + git: string | null + html: string | null + self: string + } + content?: string + download_url: string | null + git_url: string | null + html_url: string | null + name: string + path: string + sha: string + size: number + type: "dir" | "file" | "submodule" | "symlink" + url: string +}[] + +export type t_content_file = { + _links: { + git: string | null + html: string | null + self: string + } + content: string + download_url: string | null + encoding: string + git_url: string | null + html_url: string | null + name: string + path: string + sha: string + size: number + submodule_git_url?: string + target?: string + type: "file" + url: string +} + +export type t_content_submodule = { + _links: { + git: string | null + html: string | null + self: string + } + download_url: string | null + git_url: string | null + html_url: string | null + name: string + path: string + sha: string + size: number + submodule_git_url: string + type: "submodule" + url: string +} + +export type t_content_symlink = { + _links: { + git: string | null + html: string | null + self: string + } + download_url: string | null + git_url: string | null + html_url: string | null + name: string + path: string + sha: string + size: number + target: string + type: "symlink" + url: string +} + +export type t_content_traffic = { + count: number + path: string + title: string + uniques: number +} + +export type t_contributor = { + avatar_url?: string + contributions: number + email?: string + events_url?: string + followers_url?: string + following_url?: string + gists_url?: string + gravatar_id?: string | null + html_url?: string + id?: number + login?: string + name?: 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 +} + +export type t_contributor_activity = { + author: t_nullable_simple_user + total: number + weeks: { + a?: number + c?: number + d?: number + w?: number + }[] +} + +export type t_dependabot_alert = { + created_at: t_alert_created_at + readonly dependency: { + readonly manifest_path?: string + package?: t_dependabot_alert_package + readonly scope?: "development" | "runtime" | null + } + dismissed_at: t_alert_dismissed_at + dismissed_by: t_nullable_simple_user + dismissed_comment: string | null + dismissed_reason: + | "fix_started" + | "inaccurate" + | "no_bandwidth" + | "not_used" + | "tolerable_risk" + | null + fixed_at: t_alert_fixed_at + html_url: t_alert_html_url + number: t_alert_number + security_advisory: t_dependabot_alert_security_advisory + security_vulnerability: t_dependabot_alert_security_vulnerability + readonly state: "dismissed" | "fixed" | "open" + updated_at: t_alert_updated_at + url: t_alert_url +} + +export type t_dependabot_alert_package = { + readonly ecosystem: string + readonly name: string +} + +export type t_dependabot_alert_security_advisory = { + readonly cve_id: string | null + readonly cvss: { + readonly score: number + readonly vector_string: string | null + } + readonly cwes: { + readonly cwe_id: string + readonly name: string + }[] + readonly description: string + readonly ghsa_id: string + readonly identifiers: { + readonly type: "CVE" | "GHSA" + readonly value: string + }[] + readonly published_at: string + readonly references: { + readonly url: string + }[] + readonly severity: "low" | "medium" | "high" | "critical" + readonly summary: string + readonly updated_at: string + readonly vulnerabilities: t_dependabot_alert_security_vulnerability[] + readonly withdrawn_at: string | null +} + +export type t_dependabot_alert_security_vulnerability = { + readonly first_patched_version: { + readonly identifier: string + } | null + package: t_dependabot_alert_package + readonly severity: "low" | "medium" | "high" | "critical" + readonly vulnerable_version_range: string +} + +export type t_dependabot_alert_with_repository = { + created_at: t_alert_created_at + readonly dependency: { + readonly manifest_path?: string + package?: t_dependabot_alert_package + readonly scope?: "development" | "runtime" | null + } + dismissed_at: t_alert_dismissed_at + dismissed_by: t_nullable_simple_user + dismissed_comment: string | null + dismissed_reason: + | "fix_started" + | "inaccurate" + | "no_bandwidth" + | "not_used" + | "tolerable_risk" + | null + fixed_at: t_alert_fixed_at + html_url: t_alert_html_url + number: t_alert_number + repository: t_simple_repository + security_advisory: t_dependabot_alert_security_advisory + security_vulnerability: t_dependabot_alert_security_vulnerability + readonly state: "dismissed" | "fixed" | "open" + updated_at: t_alert_updated_at + url: t_alert_url +} + +export type t_dependabot_public_key = { + key: string + key_id: string +} + +export type t_dependabot_secret = { + created_at: string + name: string + updated_at: string +} + +export type t_dependency_graph_diff = { + change_type: "added" | "removed" + ecosystem: string + license: string | null + manifest: string + name: string + package_url: string | null + scope: "unknown" | "runtime" | "development" + source_repository_url: string | null + version: string + vulnerabilities: { + advisory_ghsa_id: string + advisory_summary: string + advisory_url: string + severity: string + }[] +}[] + +export type t_deploy_key = { + added_by?: string | null + created_at: string + id: number + key: string + last_used?: string | null + read_only: boolean + title: string + url: string + verified: boolean +} + +export type t_deployment = { + created_at: string + creator: t_nullable_simple_user + description: string | null + environment: string + id: number + node_id: string + original_environment?: string + payload: + | { + [key: string]: unknown + } + | string + performed_via_github_app?: t_nullable_integration + production_environment?: boolean + ref: string + repository_url: string + sha: string + statuses_url: string + task: string + transient_environment?: boolean + updated_at: string + url: string +} + +export type t_deployment_branch_policy = { + id?: number + name?: string + node_id?: string +} + +export type t_deployment_branch_policy_settings = { + custom_branch_policies: boolean + protected_branches: boolean +} + +export type t_deployment_reviewer_type = "User" | "Team" + +export type t_deployment_simple = { + created_at: string + description: string | null + environment: string + id: number + node_id: string + original_environment?: string + performed_via_github_app?: t_nullable_integration + production_environment?: boolean + repository_url: string + statuses_url: string + task: string + transient_environment?: boolean + updated_at: string + url: string +} + +export type t_deployment_status = { + created_at: string + creator: t_nullable_simple_user + deployment_url: string + description: string + environment?: string + environment_url?: string + id: number + log_url?: string + node_id: string + performed_via_github_app?: t_nullable_integration + repository_url: string + state: + | "error" + | "failure" + | "inactive" + | "pending" + | "success" + | "queued" + | "in_progress" + target_url: string + updated_at: string + url: string +} + +export type t_diff_entry = { + additions: number + blob_url: string + changes: number + contents_url: string + deletions: number + filename: string + patch?: string + previous_filename?: string + raw_url: string + sha: string + status: + | "added" + | "removed" + | "modified" + | "renamed" + | "copied" + | "changed" + | "unchanged" +} + +export type t_email = { + email: string + primary: boolean + verified: boolean + visibility: string | null +} + +export type t_empty_object = { + [key: string]: unknown +} + +export type t_enabled_repositories = "all" | "none" | "selected" + +export type t_enterprise_security_analysis_settings = { + advanced_security_enabled_for_new_repositories: boolean + secret_scanning_enabled_for_new_repositories: boolean + secret_scanning_push_protection_custom_link?: string | null + secret_scanning_push_protection_enabled_for_new_repositories: boolean +} + +export type t_environment = { + created_at: string + deployment_branch_policy?: t_deployment_branch_policy_settings + html_url: string + id: number + name: string + node_id: string + protection_rules?: { + [key: string]: unknown + }[] + updated_at: string + url: string +} + +export type t_environment_approvals = { + comment: string + environments: { + created_at?: string + html_url?: string + id?: number + name?: string + node_id?: string + updated_at?: string + url?: string + }[] + state: "approved" | "rejected" + user: t_simple_user +} + +export type t_event = { + actor: t_actor + created_at: string | null + id: string + org?: t_actor + payload: { + action?: string + comment?: t_issue_comment + issue?: t_issue + pages?: { + action?: string + html_url?: string + page_name?: string + sha?: string + summary?: string | null + title?: string + }[] + } + public: boolean + repo: { + id: number + name: string + url: string + } + type: string | null +} + +export type t_feed = { + _links: { + current_user?: t_link_with_type + current_user_actor?: t_link_with_type + current_user_organization?: t_link_with_type + current_user_organizations?: t_link_with_type[] + current_user_public?: t_link_with_type + repository_discussions?: t_link_with_type + repository_discussions_category?: t_link_with_type + security_advisories?: t_link_with_type + timeline: t_link_with_type + user: t_link_with_type + } + current_user_actor_url?: string + current_user_organization_url?: string + current_user_organization_urls?: string[] + current_user_public_url?: string + current_user_url?: string + repository_discussions_category_url?: string + repository_discussions_url?: string + security_advisories_url?: string + timeline_url: string + user_url: string +} + +export type t_file_commit = { + commit: { + author?: { + date?: string + email?: string + name?: string + } + committer?: { + date?: string + email?: string + name?: string + } + html_url?: string + message?: string + node_id?: string + parents?: { + html_url?: string + sha?: string + url?: string + }[] + sha?: string + tree?: { + sha?: string + url?: string + } + url?: string + verification?: { + payload?: string | null + reason?: string + signature?: string | null + verified?: boolean + } + } + content: { + _links?: { + git?: string + html?: string + self?: string + } + download_url?: string + git_url?: string + html_url?: string + name?: string + path?: string + sha?: string + size?: number + type?: string + url?: string + } | null +} + +export type t_full_repository = { + allow_auto_merge?: boolean + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + allow_update_branch?: boolean + anonymous_access_enabled?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + code_of_conduct?: t_code_of_conduct_simple + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string + default_branch: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_discussions: boolean + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: t_nullable_license_simple + master_branch?: string + merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK" + merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + network_count: number + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + organization?: t_nullable_simple_user + owner: t_simple_user + parent?: t_repository + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string + releases_url: string + security_and_analysis?: t_security_and_analysis + size: number + source?: t_repository + squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" + squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" + ssh_url: string + stargazers_count: number + stargazers_url: string + statuses_url: string + subscribers_count: number + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string | null + template_repository?: t_nullable_repository + topics?: string[] + trees_url: string + updated_at: string + url: string + use_squash_pr_title_as_default?: boolean + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean +} + +export type t_gist_comment = { + author_association: t_author_association + body: string + created_at: string + id: number + node_id: string + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_gist_commit = { + change_status: { + additions?: number + deletions?: number + total?: number + } + committed_at: string + url: string + user: t_nullable_simple_user + version: string +} + +export type t_gist_history = { + change_status?: { + additions?: number + deletions?: number + total?: number + } + committed_at?: string + url?: string + user?: t_nullable_simple_user + version?: string +} + +export type t_gist_simple = { + comments?: number + comments_url?: string + commits_url?: string + created_at?: string + description?: string | null + files?: { + [key: string]: unknown + } + fork_of?: { + comments: number + comments_url: string + commits_url: string + created_at: string + description: string | null + files: { + [key: string]: unknown + } + forks?: { + [key: string]: unknown + }[] + forks_url: string + git_pull_url: string + git_push_url: string + history?: { + [key: string]: unknown + }[] + html_url: string + id: string + node_id: string + owner?: t_nullable_simple_user + public: boolean + truncated?: boolean + updated_at: string + url: string + user: t_nullable_simple_user + } | null + forks?: + | { + created_at?: string + id?: string + updated_at?: string + url?: string + user?: t_public_user + }[] + | null + forks_url?: string + git_pull_url?: string + git_push_url?: string + history?: t_gist_history[] | null + html_url?: string + id?: string + node_id?: string + owner?: t_simple_user + public?: boolean + truncated?: boolean + updated_at?: string + url?: string + user?: string | null +} + +export type t_git_commit = { + author: { + date: string + email: string + name: string + } + committer: { + date: string + email: string + name: string + } + html_url: string + message: string + node_id: string + parents: { + html_url: string + sha: string + url: string + }[] + sha: string + tree: { + sha: string + url: string + } + url: string + verification: { + payload: string | null + reason: string + signature: string | null + verified: boolean + } +} + +export type t_git_ref = { + node_id: string + object: { + sha: string + type: string + url: string + } + ref: string + url: string +} + +export type t_git_tag = { + message: string + node_id: string + object: { + sha: string + type: string + url: string + } + sha: string + tag: string + tagger: { + date: string + email: string + name: string + } + url: string + verification?: t_verification +} + +export type t_git_tree = { + sha: string + tree: { + mode?: string + path?: string + sha?: string + size?: number + type?: string + url?: string + }[] + truncated: boolean + url: string +} + +export type t_gitignore_template = { + name: string + source: string +} + +export type t_gpg_key = { + can_certify: boolean + can_encrypt_comms: boolean + can_encrypt_storage: boolean + can_sign: boolean + created_at: string + emails: { + email?: string + verified?: boolean + }[] + expires_at: string | null + id: number + key_id: string + name?: string | null + primary_key_id: number | null + public_key: string + raw_key: string | null + revoked: boolean + subkeys: { + can_certify?: boolean + can_encrypt_comms?: boolean + can_encrypt_storage?: boolean + can_sign?: boolean + created_at?: string + emails?: { + [key: string]: unknown + }[] + expires_at?: string | null + id?: number + key_id?: string + primary_key_id?: number + public_key?: string + raw_key?: string | null + revoked?: boolean + subkeys?: { + [key: string]: unknown + }[] + }[] +} + +export type t_hook = { + active: boolean + config: { + content_type?: t_webhook_config_content_type + digest?: string + email?: string + insecure_ssl?: t_webhook_config_insecure_ssl + password?: string + room?: string + secret?: t_webhook_config_secret + subdomain?: string + token?: string + url?: t_webhook_config_url + } + created_at: string + deliveries_url?: string + events: string[] + id: number + last_response: t_hook_response + name: string + ping_url: string + test_url: string + type: string + updated_at: string + url: string +} + +export type t_hook_delivery = { + action: string | null + delivered_at: string + duration: number + event: string + guid: string + id: number + installation_id: number | null + redelivery: boolean + repository_id: number | null + request: { + headers: { + [key: string]: unknown + } | null + payload: { + [key: string]: unknown + } | null + } + response: { + headers: { + [key: string]: unknown + } | null + payload: string | null + } + status: string + status_code: number + url?: string +} + +export type t_hook_delivery_item = { + action: string | null + delivered_at: string + duration: number + event: string + guid: string + id: number + installation_id: number | null + redelivery: boolean + repository_id: number | null + status: string + status_code: number +} + +export type t_hook_response = { + code: number | null + message: string | null + status: string | null +} + +export type t_hovercard = { + contexts: { + message: string + octicon: string + }[] +} + +export type t_import = { + authors_count?: number | null + authors_url: string + commit_count?: number | null + error_message?: string | null + failed_step?: string | null + has_large_files?: boolean + html_url: string + import_percent?: number | null + large_files_count?: number + large_files_size?: number + message?: string + project_choices?: { + human_name?: string + tfvc_project?: string + vcs?: string + }[] + push_percent?: number | null + repository_url: string + status: + | "auth" + | "error" + | "none" + | "detecting" + | "choose" + | "auth_failed" + | "importing" + | "mapping" + | "waiting_to_push" + | "pushing" + | "complete" + | "setup" + | "unknown" + | "detection_found_multiple" + | "detection_found_nothing" + | "detection_needs_auth" + status_text?: string | null + svc_root?: string + svn_root?: string + tfvc_project?: string + url: string + use_lfs?: boolean + vcs: string | null + vcs_url: string +} + +export type t_installation = { + access_tokens_url: string + account: { + [key: string]: unknown + } | null + app_id: number + app_slug: string + contact_email?: string | null + created_at: string + events: string[] + has_multiple_single_files?: boolean + html_url: string + id: number + permissions: t_app_permissions + repositories_url: string + repository_selection: "all" | "selected" + single_file_name: string | null + single_file_paths?: string[] + suspended_at: string | null + suspended_by: t_nullable_simple_user + target_id: number + target_type: string + updated_at: string +} + +export type t_installation_token = { + expires_at: string + has_multiple_single_files?: boolean + permissions?: t_app_permissions + repositories?: t_repository[] + repository_selection?: "all" | "selected" + single_file?: string + single_file_paths?: string[] + token: string +} + +export type t_integration = { + client_id?: string + client_secret?: string + created_at: string + description: string | null + events: string[] + external_url: string + html_url: string + id: number + installations_count?: number + name: string + node_id: string + owner: t_nullable_simple_user + pem?: string + permissions: { + checks?: string + contents?: string + deployments?: string + issues?: string + metadata?: string + [key: string]: unknown + } + slug?: string + updated_at: string + webhook_secret?: string | null +} + +export type t_interaction_expiry = + | "one_day" + | "three_days" + | "one_week" + | "one_month" + | "six_months" + +export type t_interaction_group = + | "existing_users" + | "contributors_only" + | "collaborators_only" + +export type t_interaction_limit_response = { + expires_at: string + limit: t_interaction_group + origin: string +} + +export type t_issue = { + active_lock_reason?: string | null + assignee: t_nullable_simple_user + assignees?: t_simple_user[] | null + author_association: t_author_association + body?: string | null + body_html?: string + body_text?: string + closed_at: string | null + closed_by?: t_nullable_simple_user + comments: number + comments_url: string + created_at: string + draft?: boolean + events_url: string + html_url: string + id: number + labels: ( + | string + | { + color?: string | null + default?: boolean + description?: string | null + id?: number + name?: string + node_id?: string + url?: string + } + )[] + labels_url: string + locked: boolean + milestone: t_nullable_milestone + node_id: string + number: number + performed_via_github_app?: t_nullable_integration + pull_request?: { + diff_url: string | null + html_url: string | null + merged_at?: string | null + patch_url: string | null + url: string | null + } + reactions?: t_reaction_rollup + repository?: t_repository + repository_url: string + state: string + state_reason?: "completed" | "reopened" | "not_planned" | null + timeline_url?: string + title: string + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_issue_comment = { + author_association: t_author_association + body?: string + body_html?: string + body_text?: string + created_at: string + html_url: string + id: number + issue_url: string + node_id: string + performed_via_github_app?: t_nullable_integration + reactions?: t_reaction_rollup + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_issue_event = { + actor: t_nullable_simple_user + assignee?: t_nullable_simple_user + assigner?: t_nullable_simple_user + author_association?: t_author_association + commit_id: string | null + commit_url: string | null + created_at: string + dismissed_review?: t_issue_event_dismissed_review + event: string + id: number + issue?: t_nullable_issue + label?: t_issue_event_label + lock_reason?: string | null + milestone?: t_issue_event_milestone + node_id: string + performed_via_github_app?: t_nullable_integration + project_card?: t_issue_event_project_card + rename?: t_issue_event_rename + requested_reviewer?: t_nullable_simple_user + requested_team?: t_team + review_requester?: t_nullable_simple_user + url: string +} + +export type t_issue_event_dismissed_review = { + dismissal_commit_id?: string | null + dismissal_message: string | null + review_id: number + state: string +} + +export type t_issue_event_for_issue = { + [key: string]: unknown +} + +export type t_issue_event_label = { + color: string | null + name: string | null +} + +export type t_issue_event_milestone = { + title: string +} + +export type t_issue_event_project_card = { + column_name: string + id: number + previous_column_name?: string + project_id: number + project_url: string + url: string +} + +export type t_issue_event_rename = { + from: string + to: string +} + +export type t_issue_search_result_item = { + active_lock_reason?: string | null + assignee: t_nullable_simple_user + assignees?: t_simple_user[] | null + author_association: t_author_association + body?: string + body_html?: string + body_text?: string + closed_at: string | null + comments: number + comments_url: string + created_at: string + draft?: boolean + events_url: string + html_url: string + id: number + labels: { + color?: string + default?: boolean + description?: string | null + id?: number + name?: string + node_id?: string + url?: string + }[] + labels_url: string + locked: boolean + milestone: t_nullable_milestone + node_id: string + number: number + performed_via_github_app?: t_nullable_integration + pull_request?: { + diff_url: string | null + html_url: string | null + merged_at?: string | null + patch_url: string | null + url: string | null + } + reactions?: t_reaction_rollup + repository?: t_repository + repository_url: string + score: number + state: string + state_reason?: string | null + text_matches?: t_search_result_text_matches + timeline_url?: string + title: string + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_job = { + check_run_url: string + completed_at: string | null + conclusion: + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + | null + head_branch: string | null + head_sha: string + html_url: string | null + id: number + labels: string[] + name: string + node_id: string + run_attempt?: number + run_id: number + run_url: string + runner_group_id: number | null + runner_group_name: string | null + runner_id: number | null + runner_name: string | null + started_at: string + status: "queued" | "in_progress" | "completed" + steps?: { + completed_at?: string | null + conclusion: string | null + name: string + number: number + started_at?: string | null + status: "queued" | "in_progress" | "completed" + }[] + url: string + workflow_name: string | null +} + +export type t_key = { + created_at: string + id: number + key: string + read_only: boolean + title: string + url: string + verified: boolean +} + +export type t_key_simple = { + id: number + key: string +} + +export type t_label = { + color: string + default: boolean + description: string | null + id: number + name: string + node_id: string + url: string +} + +export type t_label_search_result_item = { + color: string + default: boolean + description: string | null + id: number + name: string + node_id: string + score: number + text_matches?: t_search_result_text_matches + url: string +} + +export type t_language = { + [key: string]: unknown +} + +export type t_license = { + body: string + conditions: string[] + description: string + featured: boolean + html_url: string + implementation: string + key: string + limitations: string[] + name: string + node_id: string + permissions: string[] + spdx_id: string | null + url: string | null +} + +export type t_license_content = { + _links: { + git: string | null + html: string | null + self: string + } + content: string + download_url: string | null + encoding: string + git_url: string | null + html_url: string | null + license: t_nullable_license_simple + name: string + path: string + sha: string + size: number + type: string + url: string +} + +export type t_license_simple = { + html_url?: string + key: string + name: string + node_id: string + spdx_id: string | null + url: string | null +} + +export type t_link = { + href: string +} + +export type t_link_with_type = { + href: string + type: string +} + +export type t_marketplace_account = { + email?: string | null + id: number + login: string + node_id?: string + organization_billing_email?: string | null + type: string + url: string +} + +export type t_marketplace_listing_plan = { + accounts_url: string + bullets: string[] + description: string + has_free_trial: boolean + id: number + monthly_price_in_cents: number + name: string + number: number + price_model: "FREE" | "FLAT_RATE" | "PER_UNIT" + state: string + unit_name: string | null + url: string + yearly_price_in_cents: number +} + +export type t_marketplace_purchase = { + email?: string | null + id: number + login: string + marketplace_pending_change?: { + effective_date?: string + id?: number + is_installed?: boolean + plan?: t_marketplace_listing_plan + unit_count?: number | null + } | null + marketplace_purchase: { + billing_cycle?: string + free_trial_ends_on?: string | null + is_installed?: boolean + next_billing_date?: string | null + on_free_trial?: boolean + plan?: t_marketplace_listing_plan + unit_count?: number | null + updated_at?: string + } + organization_billing_email?: string + type: string + url: string +} + +export type t_merged_upstream = { + base_branch?: string + merge_type?: "merge" | "fast-forward" | "none" + message?: string +} + +export type t_metadata = { + [key: string]: unknown +} + +export type t_migration = { + archive_url?: string + created_at: string + exclude?: { + [key: string]: unknown + }[] + exclude_attachments: boolean + exclude_git_data: boolean + exclude_metadata: boolean + exclude_owner_projects: boolean + exclude_releases: boolean + guid: string + id: number + lock_repositories: boolean + node_id: string + org_metadata_only: boolean + owner: t_nullable_simple_user + repositories: t_repository[] + state: string + updated_at: string + url: string +} + +export type t_milestone = { + closed_at: string | null + closed_issues: number + created_at: string + creator: t_nullable_simple_user + description: string | null + due_on: string | null + html_url: string + id: number + labels_url: string + node_id: string + number: number + open_issues: number + state: "open" | "closed" + title: string + updated_at: string + url: string +} + +export type t_minimal_repository = { + allow_forking?: boolean + archive_url: string + archived?: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url?: string + code_of_conduct?: t_code_of_conduct + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at?: string | null + default_branch?: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled?: boolean + downloads_url: string + events_url: string + fork: boolean + forks?: number + forks_count?: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url?: string + has_discussions?: boolean + has_downloads?: boolean + has_issues?: boolean + has_pages?: boolean + has_projects?: boolean + has_wiki?: boolean + homepage?: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language?: string | null + languages_url: string + license?: { + key?: string + name?: string + node_id?: string + spdx_id?: string + url?: string + } | null + merges_url: string + milestones_url: string + mirror_url?: string | null + name: string + network_count?: number + node_id: string + notifications_url: string + open_issues?: number + open_issues_count?: number + owner: t_simple_user + permissions?: { + admin?: boolean + maintain?: boolean + pull?: boolean + push?: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at?: string | null + releases_url: string + role_name?: string + security_and_analysis?: t_security_and_analysis + size?: number + ssh_url?: string + stargazers_count?: number + stargazers_url: string + statuses_url: string + subscribers_count?: number + subscribers_url: string + subscription_url: string + svn_url?: string + tags_url: string + teams_url: string + temp_clone_token?: string + topics?: string[] + trees_url: string + updated_at?: string | null + url: string + visibility?: string + watchers?: number + watchers_count?: number + web_commit_signoff_required?: boolean +} + +export type t_nullable_alert_updated_at = string + +export type t_nullable_code_of_conduct_simple = { + html_url: string | null + key: string + name: string + url: string +} + +export type t_nullable_codespace_machine = { + cpus: number + display_name: string + memory_in_bytes: number + name: string + operating_system: string + prebuild_availability: "none" | "ready" | "in_progress" | null + storage_in_bytes: number +} + +export type t_nullable_collaborator = { + avatar_url: string + email?: string | null + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + html_url: string + id: number + login: string + name?: string | null + node_id: string + organizations_url: string + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + received_events_url: string + repos_url: string + role_name: string + site_admin: boolean + starred_url: string + subscriptions_url: string + type: string + url: string +} + +export type t_nullable_community_health_file = { + html_url: string + url: string +} + +export type t_nullable_git_user = { + date?: string + email?: string + name?: string +} + +export type t_nullable_integration = { + client_id?: string + client_secret?: string + created_at: string + description: string | null + events: string[] + external_url: string + html_url: string + id: number + installations_count?: number + name: string + node_id: string + owner: t_nullable_simple_user + pem?: string + permissions: { + checks?: string + contents?: string + deployments?: string + issues?: string + metadata?: string + [key: string]: unknown + } + slug?: string + updated_at: string + webhook_secret?: string | null +} + +export type t_nullable_issue = { + active_lock_reason?: string | null + assignee: t_nullable_simple_user + assignees?: t_simple_user[] | null + author_association: t_author_association + body?: string | null + body_html?: string + body_text?: string + closed_at: string | null + closed_by?: t_nullable_simple_user + comments: number + comments_url: string + created_at: string + draft?: boolean + events_url: string + html_url: string + id: number + labels: ( + | string + | { + color?: string | null + default?: boolean + description?: string | null + id?: number + name?: string + node_id?: string + url?: string + } + )[] + labels_url: string + locked: boolean + milestone: t_nullable_milestone + node_id: string + number: number + performed_via_github_app?: t_nullable_integration + pull_request?: { + diff_url: string | null + html_url: string | null + merged_at?: string | null + patch_url: string | null + url: string | null + } + reactions?: t_reaction_rollup + repository?: t_repository + repository_url: string + state: string + state_reason?: "completed" | "reopened" | "not_planned" | null + timeline_url?: string + title: string + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_nullable_license_simple = { + html_url?: string + key: string + name: string + node_id: string + spdx_id: string | null + url: string | null +} + +export type t_nullable_milestone = { + closed_at: string | null + closed_issues: number + created_at: string + creator: t_nullable_simple_user + description: string | null + due_on: string | null + html_url: string + id: number + labels_url: string + node_id: string + number: number + open_issues: number + state: "open" | "closed" + title: string + updated_at: string + url: string +} + +export type t_nullable_minimal_repository = { + allow_forking?: boolean + archive_url: string + archived?: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url?: string + code_of_conduct?: t_code_of_conduct + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at?: string | null + default_branch?: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled?: boolean + downloads_url: string + events_url: string + fork: boolean + forks?: number + forks_count?: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url?: string + has_discussions?: boolean + has_downloads?: boolean + has_issues?: boolean + has_pages?: boolean + has_projects?: boolean + has_wiki?: boolean + homepage?: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language?: string | null + languages_url: string + license?: { + key?: string + name?: string + node_id?: string + spdx_id?: string + url?: string + } | null + merges_url: string + milestones_url: string + mirror_url?: string | null + name: string + network_count?: number + node_id: string + notifications_url: string + open_issues?: number + open_issues_count?: number + owner: t_simple_user + permissions?: { + admin?: boolean + maintain?: boolean + pull?: boolean + push?: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at?: string | null + releases_url: string + role_name?: string + security_and_analysis?: t_security_and_analysis + size?: number + ssh_url?: string + stargazers_count?: number + stargazers_url: string + statuses_url: string + subscribers_count?: number + subscribers_url: string + subscription_url: string + svn_url?: string + tags_url: string + teams_url: string + temp_clone_token?: string + topics?: string[] + trees_url: string + updated_at?: string | null + url: string + visibility?: string + watchers?: number + watchers_count?: number + web_commit_signoff_required?: boolean +} + +export type t_nullable_repository = { + allow_auto_merge?: boolean + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + allow_update_branch?: boolean + anonymous_access_enabled?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string | null + default_branch: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_discussions?: boolean + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: t_nullable_license_simple + master_branch?: string + merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK" + merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + network_count?: number + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + organization?: t_nullable_simple_user + owner: t_simple_user + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string | null + releases_url: string + size: number + squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" + squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" + ssh_url: string + stargazers_count: number + stargazers_url: string + starred_at?: string + statuses_url: string + subscribers_count?: number + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string + template_repository?: { + allow_auto_merge?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + allow_update_branch?: boolean + archive_url?: string + archived?: boolean + assignees_url?: string + blobs_url?: string + branches_url?: string + clone_url?: string + collaborators_url?: string + comments_url?: string + commits_url?: string + compare_url?: string + contents_url?: string + contributors_url?: string + created_at?: string + default_branch?: string + delete_branch_on_merge?: boolean + deployments_url?: string + description?: string + disabled?: boolean + downloads_url?: string + events_url?: string + fork?: boolean + forks_count?: number + forks_url?: string + full_name?: string + git_commits_url?: string + git_refs_url?: string + git_tags_url?: string + git_url?: string + has_downloads?: boolean + has_issues?: boolean + has_pages?: boolean + has_projects?: boolean + has_wiki?: boolean + homepage?: string + hooks_url?: string + html_url?: string + id?: number + is_template?: boolean + issue_comment_url?: string + issue_events_url?: string + issues_url?: string + keys_url?: string + labels_url?: string + language?: string + languages_url?: string + merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK" + merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" + merges_url?: string + milestones_url?: string + mirror_url?: string + name?: string + network_count?: number + node_id?: string + notifications_url?: string + open_issues_count?: number + owner?: { + 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 + } + permissions?: { + admin?: boolean + maintain?: boolean + pull?: boolean + push?: boolean + triage?: boolean + } + private?: boolean + pulls_url?: string + pushed_at?: string + releases_url?: string + size?: number + squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" + squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" + ssh_url?: string + stargazers_count?: number + stargazers_url?: string + statuses_url?: string + subscribers_count?: number + subscribers_url?: string + subscription_url?: string + svn_url?: string + tags_url?: string + teams_url?: string + temp_clone_token?: string + topics?: string[] + trees_url?: string + updated_at?: string + url?: string + use_squash_pr_title_as_default?: boolean + visibility?: string + watchers_count?: number + } | null + topics?: string[] + trees_url: string + updated_at: string | null + url: string + use_squash_pr_title_as_default?: boolean + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean +} + +export type t_nullable_scoped_installation = { + account: t_simple_user + has_multiple_single_files?: boolean + permissions: t_app_permissions + repositories_url: string + repository_selection: "all" | "selected" + single_file_name: string | null + single_file_paths?: string[] +} + +export type t_nullable_simple_commit = { + author: { + email: string + name: string + } | null + committer: { + email: string + name: string + } | null + id: string + message: string + timestamp: string + tree_id: string +} + +export type t_nullable_simple_user = { + avatar_url: string + email?: string | null + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + html_url: string + id: number + login: string + name?: string | null + node_id: string + organizations_url: string + received_events_url: string + repos_url: string + site_admin: boolean + starred_at?: string + starred_url: string + subscriptions_url: string + type: string + url: string +} + +export type t_nullable_team_simple = { + description: string | null + html_url: string + id: number + ldap_dn?: string + members_url: string + name: string + node_id: string + permission: string + privacy?: string + repositories_url: string + slug: string + url: string +} + +export type t_oidc_custom_sub = { + include_claim_keys: string[] +} + +export type t_oidc_custom_sub_repo = { + include_claim_keys?: string[] + use_default: boolean +} + +export type t_org_hook = { + active: boolean + config: { + content_type?: string + insecure_ssl?: string + secret?: string + url?: string + } + created_at: string + deliveries_url?: string + events: string[] + id: number + name: string + ping_url: string + type: string + updated_at: string + url: string +} + +export type t_org_membership = { + organization: t_organization_simple + organization_url: string + permissions?: { + can_create_repository: boolean + } + role: "admin" | "member" | "billing_manager" + state: "active" | "pending" + url: string + user: t_nullable_simple_user +} + +export type t_organization_actions_secret = { + created_at: string + name: string + selected_repositories_url?: string + updated_at: string + visibility: "all" | "private" | "selected" +} + +export type t_organization_actions_variable = { + created_at: string + name: string + selected_repositories_url?: string + updated_at: string + value: string + visibility: "all" | "private" | "selected" +} + +export type t_organization_dependabot_secret = { + created_at: string + name: string + selected_repositories_url?: string + updated_at: string + visibility: "all" | "private" | "selected" +} + +export type t_organization_full = { + advanced_security_enabled_for_new_repositories?: boolean + avatar_url: string + billing_email?: string | null + blog?: string + collaborators?: number | null + company?: string + created_at: string + default_repository_permission?: string | null + dependabot_alerts_enabled_for_new_repositories?: boolean + dependabot_security_updates_enabled_for_new_repositories?: boolean + dependency_graph_enabled_for_new_repositories?: boolean + description: string | null + disk_usage?: number | null + email?: string + events_url: string + followers: number + following: number + has_organization_projects: boolean + has_repository_projects: boolean + hooks_url: string + html_url: string + id: number + is_verified?: boolean + issues_url: string + location?: string + login: string + members_allowed_repository_creation_type?: string + members_can_create_internal_repositories?: boolean + members_can_create_pages?: boolean + members_can_create_private_pages?: boolean + members_can_create_private_repositories?: boolean + members_can_create_public_pages?: boolean + members_can_create_public_repositories?: boolean + members_can_create_repositories?: boolean | null + members_can_fork_private_repositories?: boolean | null + members_url: string + name?: string + node_id: string + owned_private_repos?: number + plan?: { + filled_seats?: number + name: string + private_repos: number + seats?: number + space: number + } + private_gists?: number | null + public_gists: number + public_members_url: string + public_repos: number + repos_url: string + secret_scanning_enabled_for_new_repositories?: boolean + secret_scanning_push_protection_custom_link?: string | null + secret_scanning_push_protection_custom_link_enabled?: boolean + secret_scanning_push_protection_enabled_for_new_repositories?: boolean + total_private_repos?: number + twitter_username?: string | null + two_factor_requirement_enabled?: boolean | null + type: string + updated_at: string + url: string + web_commit_signoff_required?: boolean +} + +export type t_organization_invitation = { + created_at: string + email: string | null + failed_at?: string | null + failed_reason?: string | null + id: number + invitation_source?: string + invitation_teams_url: string + inviter: t_simple_user + login: string | null + node_id: string + role: string + team_count: number +} + +export type t_organization_secret_scanning_alert = { + created_at?: t_alert_created_at + html_url?: t_alert_html_url + locations_url?: string + number?: t_alert_number + push_protection_bypassed?: boolean | null + push_protection_bypassed_at?: string | null + push_protection_bypassed_by?: t_nullable_simple_user + repository?: t_simple_repository + resolution?: t_secret_scanning_alert_resolution + resolution_comment?: string | null + resolved_at?: string | null + resolved_by?: t_nullable_simple_user + secret?: string + secret_type?: string + secret_type_display_name?: string + state?: t_secret_scanning_alert_state + updated_at?: t_nullable_alert_updated_at + url?: t_alert_url +} + +export type t_organization_simple = { + avatar_url: string + description: string | null + events_url: string + hooks_url: string + id: number + issues_url: string + login: string + members_url: string + node_id: string + public_members_url: string + repos_url: string + url: string +} + +export type t_package = { + created_at: string + html_url: string + id: number + name: string + owner?: t_nullable_simple_user + package_type: "npm" | "maven" | "rubygems" | "docker" | "nuget" | "container" + repository?: t_nullable_minimal_repository + updated_at: string + url: string + version_count: number + visibility: "private" | "public" +} + +export type t_package_version = { + created_at: string + deleted_at?: string + description?: string + html_url?: string + id: number + license?: string + metadata?: { + container?: { + tags: string[] + } + docker?: { + tag?: string[] + } + package_type: + | "npm" + | "maven" + | "rubygems" + | "docker" + | "nuget" + | "container" + } + name: string + package_html_url: string + updated_at: string + url: string +} + +export type t_packages_billing_usage = { + included_gigabytes_bandwidth: number + total_gigabytes_bandwidth_used: number + total_paid_gigabytes_bandwidth_used: number +} + +export type t_page = { + build_type?: "legacy" | "workflow" | null + cname: string | null + custom_404: boolean + html_url?: string + https_certificate?: t_pages_https_certificate + https_enforced?: boolean + pending_domain_unverified_at?: string | null + protected_domain_state?: "pending" | "verified" | "unverified" | null + public: boolean + source?: t_pages_source_hash + status: "built" | "building" | "errored" | null + url: string +} + +export type t_page_build = { + commit: string + created_at: string + duration: number + error: { + message: string | null + } + pusher: t_nullable_simple_user + status: string + updated_at: string + url: string +} + +export type t_page_build_status = { + status: string + url: string +} + +export type t_page_deployment = { + page_url: string + preview_url?: string + status_url: string +} + +export type t_pages_health_check = { + alt_domain?: { + caa_error?: string | null + dns_resolves?: boolean + enforces_https?: boolean + has_cname_record?: boolean | null + has_mx_records_present?: boolean | null + host?: string + https_error?: string | null + is_a_record?: boolean | null + is_apex_domain?: boolean + is_cloudflare_ip?: boolean | null + is_cname_to_fastly?: boolean | null + is_cname_to_github_user_domain?: boolean | null + is_cname_to_pages_dot_github_dot_com?: boolean | null + is_fastly_ip?: boolean | null + is_https_eligible?: boolean | null + is_non_github_pages_ip_present?: boolean | null + is_old_ip_address?: boolean | null + is_pages_domain?: boolean + is_pointed_to_github_pages_ip?: boolean | null + is_proxied?: boolean | null + is_served_by_pages?: boolean | null + is_valid?: boolean + is_valid_domain?: boolean + nameservers?: string + reason?: string | null + responds_to_https?: boolean + should_be_a_record?: boolean | null + uri?: string + } | null + domain?: { + caa_error?: string | null + dns_resolves?: boolean + enforces_https?: boolean + has_cname_record?: boolean | null + has_mx_records_present?: boolean | null + host?: string + https_error?: string | null + is_a_record?: boolean | null + is_apex_domain?: boolean + is_cloudflare_ip?: boolean | null + is_cname_to_fastly?: boolean | null + is_cname_to_github_user_domain?: boolean | null + is_cname_to_pages_dot_github_dot_com?: boolean | null + is_fastly_ip?: boolean | null + is_https_eligible?: boolean | null + is_non_github_pages_ip_present?: boolean | null + is_old_ip_address?: boolean | null + is_pages_domain?: boolean + is_pointed_to_github_pages_ip?: boolean | null + is_proxied?: boolean | null + is_served_by_pages?: boolean | null + is_valid?: boolean + is_valid_domain?: boolean + nameservers?: string + reason?: string | null + responds_to_https?: boolean + should_be_a_record?: boolean | null + uri?: string + } +} + +export type t_pages_https_certificate = { + description: string + domains: string[] + expires_at?: string + state: + | "new" + | "authorization_created" + | "authorization_pending" + | "authorized" + | "authorization_revoked" + | "issued" + | "uploaded" + | "approved" + | "errored" + | "bad_authz" + | "destroy_pending" + | "dns_changed" +} + +export type t_pages_source_hash = { + branch: string + path: string +} + +export type t_participation_stats = { + all: number[] + owner: number[] +} + +export type t_pending_deployment = { + current_user_can_approve: boolean + environment: { + html_url?: string + id?: number + name?: string + node_id?: string + url?: string + } + reviewers: { + reviewer?: { + [key: string]: unknown + } + type?: t_deployment_reviewer_type + }[] + wait_timer: number + wait_timer_started_at: string | null +} + +export type t_porter_author = { + email: string + id: number + import_url: string + name: string + remote_id: string + remote_name: string + url: string +} + +export type t_porter_large_file = { + oid: string + path: string + ref_name: string + size: number +} + +export type t_private_user = { + avatar_url: string + bio: string | null + blog: string | null + business_plus?: boolean + collaborators: number + company: string | null + created_at: string + disk_usage: number + email: string | null + events_url: string + followers: number + followers_url: string + following: number + following_url: string + gists_url: string + gravatar_id: string | null + hireable: boolean | null + html_url: string + id: number + ldap_dn?: string + location: string | null + login: string + name: string | null + node_id: string + organizations_url: string + owned_private_repos: number + plan?: { + collaborators: number + name: string + private_repos: number + space: number + } + private_gists: number + public_gists: number + public_repos: number + received_events_url: string + repos_url: string + site_admin: boolean + starred_url: string + subscriptions_url: string + suspended_at?: string | null + total_private_repos: number + twitter_username?: string | null + two_factor_authentication: boolean + type: string + updated_at: string + url: string +} + +export type t_project = { + body: string | null + columns_url: string + created_at: string + creator: t_nullable_simple_user + html_url: string + id: number + name: string + node_id: string + number: number + organization_permission?: "read" | "write" | "admin" | "none" + owner_url: string + private?: boolean + state: string + updated_at: string + url: string +} + +export type t_project_card = { + archived?: boolean + column_name?: string + column_url: string + content_url?: string + created_at: string + creator: t_nullable_simple_user + id: number + node_id: string + note: string | null + project_id?: string + project_url: string + updated_at: string + url: string +} + +export type t_project_collaborator_permission = { + permission: string + user: t_nullable_simple_user +} + +export type t_project_column = { + cards_url: string + created_at: string + id: number + name: string + node_id: string + project_url: string + updated_at: string + url: string +} + +export type t_protected_branch = { + allow_deletions?: { + enabled: boolean + } + allow_force_pushes?: { + enabled: boolean + } + allow_fork_syncing?: { + enabled?: boolean + } + block_creations?: { + enabled: boolean + } + enforce_admins?: { + enabled: boolean + url: string + } + lock_branch?: { + enabled?: boolean + } + required_conversation_resolution?: { + enabled?: boolean + } + required_linear_history?: { + enabled: boolean + } + required_pull_request_reviews?: { + bypass_pull_request_allowances?: { + apps?: t_integration[] + teams: t_team[] + users: t_simple_user[] + } + dismiss_stale_reviews?: boolean + dismissal_restrictions?: { + apps?: t_integration[] + teams: t_team[] + teams_url: string + url: string + users: t_simple_user[] + users_url: string + } + require_code_owner_reviews?: boolean + require_last_push_approval?: boolean + required_approving_review_count?: number + url: string + } + required_signatures?: { + enabled: boolean + url: string + } + required_status_checks?: t_status_check_policy + restrictions?: t_branch_restriction_policy + url: string +} + +export type t_protected_branch_admin_enforced = { + enabled: boolean + url: string +} + +export type t_protected_branch_pull_request_review = { + bypass_pull_request_allowances?: { + apps?: t_integration[] + teams?: t_team[] + users?: t_simple_user[] + } + dismiss_stale_reviews: boolean + dismissal_restrictions?: { + apps?: t_integration[] + teams?: t_team[] + teams_url?: string + url?: string + users?: t_simple_user[] + users_url?: string + } + require_code_owner_reviews: boolean + require_last_push_approval?: boolean + required_approving_review_count?: number + url?: string +} + +export type t_protected_branch_required_status_check = { + checks: { + app_id: number | null + context: string + }[] + contexts: string[] + contexts_url?: string + enforcement_level?: string + strict?: boolean + url?: string +} + +export type t_public_user = { + avatar_url: string + bio: string | null + blog: string | null + collaborators?: number + company: string | null + created_at: string + disk_usage?: number + email: string | null + events_url: string + followers: number + followers_url: string + following: number + following_url: string + gists_url: string + gravatar_id: string | null + hireable: boolean | null + html_url: string + id: number + location: string | null + login: string + name: string | null + node_id: string + organizations_url: string + owned_private_repos?: number + plan?: { + collaborators: number + name: string + private_repos: number + space: number + } + private_gists?: number + public_gists: number + public_repos: number + received_events_url: string + repos_url: string + site_admin: boolean + starred_url: string + subscriptions_url: string + suspended_at?: string | null + total_private_repos?: number + twitter_username?: string | null + type: string + updated_at: string + url: string +} + +export type t_pull_request = { + _links: { + comments: t_link + commits: t_link + html: t_link + issue: t_link + review_comment: t_link + review_comments: t_link + self: t_link + statuses: t_link + } + active_lock_reason?: string | null + additions: number + assignee: t_nullable_simple_user + assignees?: t_simple_user[] | null + author_association: t_author_association + auto_merge: t_auto_merge + base: { + label: string + ref: string + repo: { + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string + default_branch: string + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_discussions: boolean + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: t_nullable_license_simple + master_branch?: string + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + owner: { + avatar_url: string + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + 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 + } + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string + releases_url: string + size: number + ssh_url: string + stargazers_count: number + stargazers_url: string + statuses_url: string + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string + topics?: string[] + trees_url: string + updated_at: string + url: string + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean + } + sha: string + user: { + avatar_url: string + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + 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 + } + } + body: string | null + changed_files: number + closed_at: string | null + comments: number + comments_url: string + commits: number + commits_url: string + created_at: string + deletions: number + diff_url: string + draft?: boolean + head: { + label: string + ref: string + repo: { + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string + default_branch: string + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_discussions: boolean + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: { + key: string + name: string + node_id: string + spdx_id: string | null + url: string | null + } | null + master_branch?: string + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + owner: { + avatar_url: string + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + 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 + } + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string + releases_url: string + size: number + ssh_url: string + stargazers_count: number + stargazers_url: string + statuses_url: string + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string + topics?: string[] + trees_url: string + updated_at: string + url: string + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean + } | null + sha: string + user: { + avatar_url: string + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + 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 + } + } + html_url: string + id: number + issue_url: string + labels: { + color: string + default: boolean + description: string | null + id: number + name: string + node_id: string + url: string + }[] + locked: boolean + maintainer_can_modify: boolean + merge_commit_sha: string | null + mergeable: boolean | null + mergeable_state: string + merged: boolean + merged_at: string | null + merged_by: t_nullable_simple_user + milestone: t_nullable_milestone + node_id: string + number: number + patch_url: string + rebaseable?: boolean | null + requested_reviewers?: t_simple_user[] | null + requested_teams?: t_team_simple[] | null + review_comment_url: string + review_comments: number + review_comments_url: string + state: "open" | "closed" + statuses_url: string + title: string + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_pull_request_merge_result = { + merged: boolean + message: string + sha: string +} + +export type t_pull_request_minimal = { + base: { + ref: string + repo: { + id: number + name: string + url: string + } + sha: string + } + head: { + ref: string + repo: { + id: number + name: string + url: string + } + sha: string + } + id: number + number: number + url: string +} + +export type t_pull_request_review = { + _links: { + html: { + href: string + } + pull_request: { + href: string + } + } + author_association: t_author_association + body: string + body_html?: string + body_text?: string + commit_id: string | null + html_url: string + id: number + node_id: string + pull_request_url: string + state: string + submitted_at?: string + user: t_nullable_simple_user +} + +export type t_pull_request_review_comment = { + _links: { + html: { + href: string + } + pull_request: { + href: string + } + self: { + href: string + } + } + author_association: t_author_association + body: string + body_html?: string + body_text?: string + commit_id: string + created_at: string + diff_hunk: string + html_url: string + id: number + in_reply_to_id?: number + line?: number + node_id: string + original_commit_id: string + original_line?: number + original_position: number + original_start_line?: number | null + path: string + position: number + pull_request_review_id: number | null + pull_request_url: string + reactions?: t_reaction_rollup + side?: "LEFT" | "RIGHT" + start_line?: number | null + start_side?: "LEFT" | "RIGHT" | null + updated_at: string + url: string + user: t_simple_user +} + +export type t_pull_request_review_request = { + teams: t_team[] + users: t_simple_user[] +} + +export type t_pull_request_simple = { + _links: { + comments: t_link + commits: t_link + html: t_link + issue: t_link + review_comment: t_link + review_comments: t_link + self: t_link + statuses: t_link + } + active_lock_reason?: string | null + assignee: t_nullable_simple_user + assignees?: t_simple_user[] | null + author_association: t_author_association + auto_merge: t_auto_merge + base: { + label: string + ref: string + repo: t_repository + sha: string + user: t_nullable_simple_user + } + body: string | null + closed_at: string | null + comments_url: string + commits_url: string + created_at: string + diff_url: string + draft?: boolean + head: { + label: string + ref: string + repo: t_repository + sha: string + user: t_nullable_simple_user + } + html_url: string + id: number + issue_url: string + labels: { + color: string + default: boolean + description: string + id: number + name: string + node_id: string + url: string + }[] + locked: boolean + merge_commit_sha: string | null + merged_at: string | null + milestone: t_nullable_milestone + node_id: string + number: number + patch_url: string + requested_reviewers?: t_simple_user[] | null + requested_teams?: t_team[] | null + review_comment_url: string + review_comments_url: string + state: string + statuses_url: string + title: string + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_rate_limit = { + limit: number + remaining: number + reset: number + used: number +} + +export type t_rate_limit_overview = { + rate: t_rate_limit + resources: { + actions_runner_registration?: t_rate_limit + code_scanning_upload?: t_rate_limit + core: t_rate_limit + dependency_snapshots?: t_rate_limit + graphql?: t_rate_limit + integration_manifest?: t_rate_limit + scim?: t_rate_limit + search: t_rate_limit + source_import?: t_rate_limit + } +} + +export type t_reaction = { + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes" + created_at: string + id: number + node_id: string + user: t_nullable_simple_user +} + +export type t_reaction_rollup = { + "+1": number + "-1": number + confused: number + eyes: number + heart: number + hooray: number + laugh: number + rocket: number + total_count: number + url: string +} + +export type t_referenced_workflow = { + path: string + ref?: string + sha: string +} + +export type t_referrer_traffic = { + count: number + referrer: string + uniques: number +} + +export type t_release = { + assets: t_release_asset[] + assets_url: string + author: t_simple_user + body?: string | null + body_html?: string + body_text?: string + created_at: string + discussion_url?: string + draft: boolean + html_url: string + id: number + mentions_count?: number + name: string | null + node_id: string + prerelease: boolean + published_at: string | null + reactions?: t_reaction_rollup + tag_name: string + tarball_url: string | null + target_commitish: string + upload_url: string + url: string + zipball_url: string | null +} + +export type t_release_asset = { + browser_download_url: string + content_type: string + created_at: string + download_count: number + id: number + label: string | null + name: string + node_id: string + size: number + state: "uploaded" | "open" + updated_at: string + uploader: t_nullable_simple_user + url: string +} + +export type t_release_notes_content = { + body: string + name: string +} + +export type t_repo_codespaces_secret = { + created_at: string + name: string + updated_at: string +} + +export type t_repo_required_workflow = { + badge_url: string + created_at: string + html_url: string + id: number + name: string + node_id: string + path: string + source_repository: t_minimal_repository + state: "active" | "deleted" + updated_at: string + url: string +} + +export type t_repo_search_result_item = { + allow_auto_merge?: boolean + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string + default_branch: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_discussions?: boolean + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: t_nullable_license_simple + master_branch?: string + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + owner: t_nullable_simple_user + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string + releases_url: string + score: number + size: number + ssh_url: string + stargazers_count: number + stargazers_url: string + statuses_url: string + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string + text_matches?: t_search_result_text_matches + topics?: string[] + trees_url: string + updated_at: string + url: string + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean +} + +export type t_repository = { + allow_auto_merge?: boolean + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + allow_update_branch?: boolean + anonymous_access_enabled?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string | null + default_branch: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_discussions?: boolean + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: t_nullable_license_simple + master_branch?: string + merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK" + merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + network_count?: number + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + organization?: t_nullable_simple_user + owner: t_simple_user + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string | null + releases_url: string + size: number + squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" + squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" + ssh_url: string + stargazers_count: number + stargazers_url: string + starred_at?: string + statuses_url: string + subscribers_count?: number + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string + template_repository?: { + allow_auto_merge?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + allow_update_branch?: boolean + archive_url?: string + archived?: boolean + assignees_url?: string + blobs_url?: string + branches_url?: string + clone_url?: string + collaborators_url?: string + comments_url?: string + commits_url?: string + compare_url?: string + contents_url?: string + contributors_url?: string + created_at?: string + default_branch?: string + delete_branch_on_merge?: boolean + deployments_url?: string + description?: string + disabled?: boolean + downloads_url?: string + events_url?: string + fork?: boolean + forks_count?: number + forks_url?: string + full_name?: string + git_commits_url?: string + git_refs_url?: string + git_tags_url?: string + git_url?: string + has_downloads?: boolean + has_issues?: boolean + has_pages?: boolean + has_projects?: boolean + has_wiki?: boolean + homepage?: string + hooks_url?: string + html_url?: string + id?: number + is_template?: boolean + issue_comment_url?: string + issue_events_url?: string + issues_url?: string + keys_url?: string + labels_url?: string + language?: string + languages_url?: string + merge_commit_message?: "PR_BODY" | "PR_TITLE" | "BLANK" + merge_commit_title?: "PR_TITLE" | "MERGE_MESSAGE" + merges_url?: string + milestones_url?: string + mirror_url?: string + name?: string + network_count?: number + node_id?: string + notifications_url?: string + open_issues_count?: number + owner?: { + 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 + } + permissions?: { + admin?: boolean + maintain?: boolean + pull?: boolean + push?: boolean + triage?: boolean + } + private?: boolean + pulls_url?: string + pushed_at?: string + releases_url?: string + size?: number + squash_merge_commit_message?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" + squash_merge_commit_title?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" + ssh_url?: string + stargazers_count?: number + stargazers_url?: string + statuses_url?: string + subscribers_count?: number + subscribers_url?: string + subscription_url?: string + svn_url?: string + tags_url?: string + teams_url?: string + temp_clone_token?: string + topics?: string[] + trees_url?: string + updated_at?: string + url?: string + use_squash_pr_title_as_default?: boolean + visibility?: string + watchers_count?: number + } | null + topics?: string[] + trees_url: string + updated_at: string | null + url: string + use_squash_pr_title_as_default?: boolean + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean +} + +export type t_repository_collaborator_permission = { + permission: string + role_name: string + user: t_nullable_collaborator +} + +export type t_repository_invitation = { + created_at: string + expired?: boolean + html_url: string + id: number + invitee: t_nullable_simple_user + inviter: t_nullable_simple_user + node_id: string + permissions: "read" | "write" | "admin" | "triage" | "maintain" + repository: t_minimal_repository + url: string +} + +export type t_repository_subscription = { + created_at: string + ignored: boolean + reason: string | null + repository_url: string + subscribed: boolean + url: string +} + +export type t_required_workflow = { + created_at: string + id: number + name: string + path: string + ref: string + repository: t_minimal_repository + scope: "all" | "selected" + selected_repositories_url?: string + state: "active" | "deleted" + updated_at: string +} + +export type t_review_comment = { + _links: { + html: t_link + pull_request: t_link + self: t_link + } + author_association: t_author_association + body: string + body_html?: string + body_text?: string + commit_id: string + created_at: string + diff_hunk: string + html_url: string + id: number + in_reply_to_id?: number + line?: number + node_id: string + original_commit_id: string + original_line?: number + original_position: number + original_start_line?: number | null + path: string + position: number | null + pull_request_review_id: number | null + pull_request_url: string + reactions?: t_reaction_rollup + side?: "LEFT" | "RIGHT" + start_line?: number | null + start_side?: "LEFT" | "RIGHT" | null + updated_at: string + url: string + user: t_nullable_simple_user +} + +export type t_root = { + authorizations_url: string + code_search_url: string + commit_search_url: string + current_user_authorizations_html_url: string + current_user_repositories_url: string + current_user_url: string + emails_url: string + emojis_url: string + events_url: string + feeds_url: string + followers_url: string + following_url: string + gists_url: string + hub_url: string + issue_search_url: string + issues_url: string + keys_url: string + label_search_url: string + notifications_url: string + organization_repositories_url: string + organization_teams_url: string + organization_url: string + public_gists_url: string + rate_limit_url: string + repository_search_url: string + repository_url: string + starred_gists_url: string + starred_url: string + topic_search_url?: string + user_organizations_url: string + user_repositories_url: string + user_search_url: string + user_url: string +} + +export type t_runner = { + busy: boolean + id: number + labels: t_runner_label[] + name: string + os: string + status: string +} + +export type t_runner_application = { + architecture: string + download_url: string + filename: string + os: string + sha256_checksum?: string + temp_download_token?: string +} + +export type t_runner_groups_enterprise = { + allows_public_repositories: boolean + default: boolean + id: number + name: string + restricted_to_workflows?: boolean + runners_url: string + selected_organizations_url?: string + selected_workflows?: string[] + visibility: string + workflow_restrictions_read_only?: boolean +} + +export type t_runner_groups_org = { + allows_public_repositories: boolean + default: boolean + id: number + inherited: boolean + inherited_allows_public_repositories?: boolean + name: string + restricted_to_workflows?: boolean + runners_url: string + selected_repositories_url?: string + selected_workflows?: string[] + visibility: string + workflow_restrictions_read_only?: boolean +} + +export type t_runner_label = { + id?: number + name: string + type?: "read-only" | "custom" +} + +export type t_scim_error = { + detail?: string | null + documentation_url?: string | null + message?: string | null + schemas?: string[] + scimType?: string | null + status?: number +} + +export type t_search_result_text_matches = { + fragment?: string + matches?: { + indices?: number[] + text?: string + }[] + object_type?: string | null + object_url?: string + property?: string +}[] + +export type t_secret_scanning_alert = { + created_at?: t_alert_created_at + html_url?: t_alert_html_url + locations_url?: string + number?: t_alert_number + push_protection_bypassed?: boolean | null + push_protection_bypassed_at?: string | null + push_protection_bypassed_by?: t_nullable_simple_user + resolution?: t_secret_scanning_alert_resolution + resolution_comment?: string | null + resolved_at?: string | null + resolved_by?: t_nullable_simple_user + secret?: string + secret_type?: string + secret_type_display_name?: string + state?: t_secret_scanning_alert_state + updated_at?: t_nullable_alert_updated_at + url?: t_alert_url +} + +export type t_secret_scanning_alert_resolution = + | "null" + | "false_positive" + | "wont_fix" + | "revoked" + | "used_in_tests" + +export type t_secret_scanning_alert_resolution_comment = string + +export type t_secret_scanning_alert_state = "open" | "resolved" + +export type t_secret_scanning_location = { + details: + | t_secret_scanning_location_commit + | t_secret_scanning_location_issue_title + | t_secret_scanning_location_issue_body + | t_secret_scanning_location_issue_comment + type: "commit" | "issue_title" | "issue_body" | "issue_comment" +} + +export type t_secret_scanning_location_commit = { + blob_sha: string + blob_url: string + commit_sha: string + commit_url: string + end_column: number + end_line: number + path: string + start_column: number + start_line: number +} + +export type t_secret_scanning_location_issue_body = { + issue_body_url: string +} + +export type t_secret_scanning_location_issue_comment = { + issue_comment_url: string +} + +export type t_secret_scanning_location_issue_title = { + issue_title_url: string +} + +export type t_security_and_analysis = { + advanced_security?: { + status?: "enabled" | "disabled" + } + secret_scanning?: { + status?: "enabled" | "disabled" + } + secret_scanning_push_protection?: { + status?: "enabled" | "disabled" + } +} + +export type t_selected_actions = { + github_owned_allowed?: boolean + patterns_allowed?: string[] + verified_allowed?: boolean +} + +export type t_selected_actions_url = string + +export type t_short_blob = { + sha: string + url: string +} + +export type t_short_branch = { + commit: { + sha: string + url: string + } + name: string + protected: boolean + protection?: t_branch_protection + protection_url?: string +} + +export type t_simple_commit = { + author: { + email: string + name: string + } | null + committer: { + email: string + name: string + } | null + id: string + message: string + timestamp: string + tree_id: string +} + +export type t_simple_commit_status = { + avatar_url: string | null + context: string + created_at: string + description: string | null + id: number + node_id: string + required?: boolean | null + state: string + target_url: string | null + updated_at: string + url: string +} + +export type t_simple_repository = { + archive_url: string + assignees_url: string + blobs_url: string + branches_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + deployments_url: string + description: string | null + downloads_url: string + events_url: string + fork: boolean + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + hooks_url: string + html_url: string + id: number + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + languages_url: string + merges_url: string + milestones_url: string + name: string + node_id: string + notifications_url: string + owner: t_simple_user + private: boolean + pulls_url: string + releases_url: string + stargazers_url: string + statuses_url: string + subscribers_url: string + subscription_url: string + tags_url: string + teams_url: string + trees_url: string + url: string +} + +export type t_simple_user = { + avatar_url: string + email?: string | null + events_url: string + followers_url: string + following_url: string + gists_url: string + gravatar_id: string | null + html_url: string + id: number + login: string + name?: string | null + node_id: string + organizations_url: string + received_events_url: string + repos_url: string + site_admin: boolean + starred_at?: string + starred_url: string + subscriptions_url: string + type: string + url: string +} + +export type t_ssh_signing_key = { + created_at: string + id: number + key: string + title: string +} + +export type t_starred_repository = { + repo: t_repository + starred_at: string +} + +export type t_status = { + avatar_url: string | null + context: string + created_at: string + creator: t_nullable_simple_user + description: string | null + id: number + node_id: string + state: string + target_url: string | null + updated_at: string + url: string +} + +export type t_status_check_policy = { + checks: { + app_id: number | null + context: string + }[] + contexts: string[] + contexts_url: string + strict: boolean + url: string +} + +export type t_tag = { + commit: { + sha: string + url: string + } + name: string + node_id: string + tarball_url: string + zipball_url: string +} + +export type t_tag_protection = { + created_at?: string + enabled?: boolean + id?: number + pattern: string + updated_at?: string +} + +export type t_team = { + description: string | null + html_url: string + id: number + members_url: string + name: string + node_id: string + parent: t_nullable_team_simple + permission: string + permissions?: { + admin: boolean + maintain: boolean + pull: boolean + push: boolean + triage: boolean + } + privacy?: string + repositories_url: string + slug: string + url: string +} + +export type t_team_discussion = { + author: t_nullable_simple_user + body: string + body_html: string + body_version: string + comments_count: number + comments_url: string + created_at: string + html_url: string + last_edited_at: string | null + node_id: string + number: number + pinned: boolean + private: boolean + reactions?: t_reaction_rollup + team_url: string + title: string + updated_at: string + url: string +} + +export type t_team_discussion_comment = { + author: t_nullable_simple_user + body: string + body_html: string + body_version: string + created_at: string + discussion_url: string + html_url: string + last_edited_at: string | null + node_id: string + number: number + reactions?: t_reaction_rollup + updated_at: string + url: string +} + +export type t_team_full = { + created_at: string + description: string | null + html_url: string + id: number + ldap_dn?: string + members_count: number + members_url: string + name: string + node_id: string + organization: t_team_organization + parent?: t_nullable_team_simple + permission: string + privacy?: "closed" | "secret" + repos_count: number + repositories_url: string + slug: string + updated_at: string + url: string +} + +export type t_team_membership = { + role: "member" | "maintainer" + state: "active" | "pending" + url: string +} + +export type t_team_organization = { + avatar_url: string + billing_email?: string | null + blog?: string + collaborators?: number | null + company?: string + created_at: string + default_repository_permission?: string | null + description: string | null + disk_usage?: number | null + email?: string + events_url: string + followers: number + following: number + has_organization_projects: boolean + has_repository_projects: boolean + hooks_url: string + html_url: string + id: number + is_verified?: boolean + issues_url: string + location?: string + login: string + members_allowed_repository_creation_type?: string + members_can_create_internal_repositories?: boolean + members_can_create_pages?: boolean + members_can_create_private_pages?: boolean + members_can_create_private_repositories?: boolean + members_can_create_public_pages?: boolean + members_can_create_public_repositories?: boolean + members_can_create_repositories?: boolean | null + members_can_fork_private_repositories?: boolean | null + members_url: string + name?: string + node_id: string + owned_private_repos?: number + plan?: { + filled_seats?: number + name: string + private_repos: number + seats?: number + space: number + } + private_gists?: number | null + public_gists: number + public_members_url: string + public_repos: number + repos_url: string + total_private_repos?: number + twitter_username?: string | null + two_factor_requirement_enabled?: boolean | null + type: string + updated_at: string + url: string + web_commit_signoff_required?: boolean +} + +export type t_team_project = { + body: string | null + columns_url: string + created_at: string + creator: t_simple_user + html_url: string + id: number + name: string + node_id: string + number: number + organization_permission?: string + owner_url: string + permissions: { + admin: boolean + read: boolean + write: boolean + } + private?: boolean + state: string + updated_at: string + url: string +} + +export type t_team_repository = { + allow_auto_merge?: boolean + allow_forking?: boolean + allow_merge_commit?: boolean + allow_rebase_merge?: boolean + allow_squash_merge?: boolean + archive_url: string + archived: boolean + assignees_url: string + blobs_url: string + branches_url: string + clone_url: string + collaborators_url: string + comments_url: string + commits_url: string + compare_url: string + contents_url: string + contributors_url: string + created_at: string | null + default_branch: string + delete_branch_on_merge?: boolean + deployments_url: string + description: string | null + disabled: boolean + downloads_url: string + events_url: string + fork: boolean + forks: number + forks_count: number + forks_url: string + full_name: string + git_commits_url: string + git_refs_url: string + git_tags_url: string + git_url: string + has_downloads: boolean + has_issues: boolean + has_pages: boolean + has_projects: boolean + has_wiki: boolean + homepage: string | null + hooks_url: string + html_url: string + id: number + is_template?: boolean + issue_comment_url: string + issue_events_url: string + issues_url: string + keys_url: string + labels_url: string + language: string | null + languages_url: string + license: t_nullable_license_simple + master_branch?: string + merges_url: string + milestones_url: string + mirror_url: string | null + name: string + network_count?: number + node_id: string + notifications_url: string + open_issues: number + open_issues_count: number + owner: t_nullable_simple_user + permissions?: { + admin: boolean + maintain?: boolean + pull: boolean + push: boolean + triage?: boolean + } + private: boolean + pulls_url: string + pushed_at: string | null + releases_url: string + role_name?: string + size: number + ssh_url: string + stargazers_count: number + stargazers_url: string + statuses_url: string + subscribers_count?: number + subscribers_url: string + subscription_url: string + svn_url: string + tags_url: string + teams_url: string + temp_clone_token?: string + template_repository?: t_nullable_repository + topics?: string[] + trees_url: string + updated_at: string | null + url: string + visibility?: string + watchers: number + watchers_count: number + web_commit_signoff_required?: boolean +} + +export type t_team_simple = { + description: string | null + html_url: string + id: number + ldap_dn?: string + members_url: string + name: string + node_id: string + permission: string + privacy?: string + repositories_url: string + slug: string + url: string +} + +export type t_thread = { + id: string + last_read_at: string | null + reason: string + repository: t_minimal_repository + subject: { + latest_comment_url: string + title: string + type: string + url: string + } + subscription_url: string + unread: boolean + updated_at: string + url: string +} + +export type t_thread_subscription = { + created_at: string | null + ignored: boolean + reason: string | null + repository_url?: string + subscribed: boolean + thread_url?: string + url: string +} + +export type t_timeline_issue_events = { + [key: string]: unknown +} + +export type t_topic = { + names: string[] +} + +export type t_topic_search_result_item = { + aliases?: + | { + topic_relation?: { + id?: number + name?: string + relation_type?: string + topic_id?: number + } + }[] + | null + created_at: string + created_by: string | null + curated: boolean + description: string | null + display_name: string | null + featured: boolean + logo_url?: string | null + name: string + related?: + | { + topic_relation?: { + id?: number + name?: string + relation_type?: string + topic_id?: number + } + }[] + | null + released: string | null + repository_count?: number | null + score: number + short_description: string | null + text_matches?: t_search_result_text_matches + updated_at: string +} + +export type t_traffic = { + count: number + timestamp: string + uniques: number +} + +export type t_user_marketplace_purchase = { + account: t_marketplace_account + billing_cycle: string + free_trial_ends_on: string | null + next_billing_date: string | null + on_free_trial: boolean + plan: t_marketplace_listing_plan + unit_count: number | null + updated_at: string | null +} + +export type t_user_search_result_item = { + avatar_url: string + bio?: string | null + blog?: string | null + company?: string | null + created_at?: string + email?: string | null + events_url: string + followers?: number + followers_url: string + following?: number + following_url: string + gists_url: string + gravatar_id: string | null + hireable?: boolean | null + html_url: string + id: number + location?: string | null + login: string + name?: string | null + node_id: string + organizations_url: string + public_gists?: number + public_repos?: number + received_events_url: string + repos_url: string + score: number + site_admin: boolean + starred_url: string + subscriptions_url: string + suspended_at?: string | null + text_matches?: t_search_result_text_matches + type: string + updated_at?: string + url: string +} + +export type t_validation_error = { + documentation_url: string + errors?: { + code: string + field?: string + index?: number + message?: string + resource?: string + value?: string | number | string[] + }[] + message: string +} + +export type t_validation_error_simple = { + documentation_url: string + errors?: string[] + message: string +} + +export type t_verification = { + payload: string | null + reason: string + signature: string | null + verified: boolean +} + +export type t_view_traffic = { + count: number + uniques: number + views: t_traffic[] +} + +export type t_wait_timer = number + +export type t_webhook_config = { + content_type?: t_webhook_config_content_type + insecure_ssl?: t_webhook_config_insecure_ssl + secret?: t_webhook_config_secret + url?: t_webhook_config_url +} + +export type t_webhook_config_content_type = string + +export type t_webhook_config_insecure_ssl = string | number + +export type t_webhook_config_secret = string + +export type t_webhook_config_url = string + +export type t_workflow = { + badge_url: string + created_at: string + deleted_at?: string + html_url: string + id: number + name: string + node_id: string + path: string + state: + | "active" + | "deleted" + | "disabled_fork" + | "disabled_inactivity" + | "disabled_manually" + updated_at: string + url: string +} + +export type t_workflow_run = { + actor?: t_simple_user + artifacts_url: string + cancel_url: string + check_suite_id?: number + check_suite_node_id?: string + check_suite_url: string + conclusion: string | null + created_at: string + display_title: string + event: string + head_branch: string | null + head_commit: t_nullable_simple_commit + head_repository: t_minimal_repository + head_repository_id?: number + head_sha: string + html_url: string + id: number + jobs_url: string + logs_url: string + name?: string | null + node_id: string + path: string + previous_attempt_url?: string | null + pull_requests: t_pull_request_minimal[] | null + referenced_workflows?: t_referenced_workflow[] | null + repository: t_minimal_repository + rerun_url: string + run_attempt?: number + run_number: number + run_started_at?: string + status: string | null + triggering_actor?: t_simple_user + updated_at: string + url: string + workflow_id: number + workflow_url: string +} + +export type t_workflow_run_usage = { + billable: { + MACOS?: { + job_runs?: { + duration_ms: number + job_id: number + }[] + jobs: number + total_ms: number + } + UBUNTU?: { + job_runs?: { + duration_ms: number + job_id: number + }[] + jobs: number + total_ms: number + } + WINDOWS?: { + job_runs?: { + duration_ms: number + job_id: number + }[] + jobs: number + total_ms: number + } + } + run_duration_ms?: number +} + +export type t_workflow_usage = { + billable: { + MACOS?: { + total_ms?: number + } + UBUNTU?: { + total_ms?: number + } + WINDOWS?: { + total_ms?: number + } + } +} export type t_ActionsAddCustomLabelsToSelfHostedRunnerForOrgBodySchema = { labels: string[] diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts index 39f584806..8dd8aec9a 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts @@ -5,12 +5,20 @@ import { t_AddPetBodySchema, t_DeletePetParamSchema, + t_Error, t_FindPetByIdParamSchema, t_FindPetsQuerySchema, + t_Pet, } from "./models" import KoaRouter from "@koa/router" import { + Response, ServerConfig, + StatusCode, + StatusCode2xx, + StatusCode3xx, + StatusCode4xx, + StatusCode5xx, startServer, } from "@nahkies/typescript-koa-runtime/server" import { @@ -27,22 +35,22 @@ import { z } from "zod" export type FindPets = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response> export type AddPet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response> export type FindPetById = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response> export type DeletePet = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise | Response> export type Implementation = { findPets: FindPets @@ -72,14 +80,22 @@ export function bootstrap( const { status, body } = await implementation.findPets(input, ctx) - if (status === 200) { - ctx.body = z.array(z.object({})).parse(body) - } else { - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z + .object({ + name: z.coerce.string(), + tag: z.coerce.string().optional(), + }) + .merge(z.object({ id: z.coerce.number() })) + ), + ], + ], + z.object({ code: z.coerce.number(), message: z.coerce.string() }) + )(status, body) ctx.status = status return next() }) @@ -98,14 +114,20 @@ export function bootstrap( const { status, body } = await implementation.addPet(input, ctx) - if (status === 200) { - ctx.body = z.object({}).parse(body) - } else { - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z + .object({ + name: z.coerce.string(), + tag: z.coerce.string().optional(), + }) + .merge(z.object({ id: z.coerce.number() })), + ], + ], + z.object({ code: z.coerce.number(), message: z.coerce.string() }) + )(status, body) ctx.status = status return next() }) @@ -121,14 +143,20 @@ export function bootstrap( const { status, body } = await implementation.findPetById(input, ctx) - if (status === 200) { - ctx.body = z.object({}).parse(body) - } else { - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z + .object({ + name: z.coerce.string(), + tag: z.coerce.string().optional(), + }) + .merge(z.object({ id: z.coerce.number() })), + ], + ], + z.object({ code: z.coerce.number(), message: z.coerce.string() }) + )(status, body) ctx.status = status return next() }) @@ -144,10 +172,10 @@ export function bootstrap( const { status, body } = await implementation.deletePet(input, ctx) - ctx.body = z - .object({ code: z.coerce.number(), message: z.coerce.string() }) - .parse(body) - + ctx.body = responseValidationFactory( + [["204", z.void()]], + z.object({ code: z.coerce.number(), message: z.coerce.string() }) + )(status, body) ctx.status = status return next() }) diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/index.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/index.ts index daf503eac..9296246d5 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/index.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/index.ts @@ -1,15 +1,19 @@ import { bootstrap, FindPetById } from "./generated" const notImplemented = async () => { - return { status: 501, body: { error: 'not implemented' } } + return { + status: 501 as const, + body: { code: 1, message: 'not implemented' } + } } const findPetById: FindPetById = async ({params}, ctx) => { switch (params.id) { case 1: return { - status: 200, + status: 200 as const, body: { + id: 1, name: "Jake", breed: "border-collie", }, @@ -17,8 +21,9 @@ const findPetById: FindPetById = async ({params}, ctx) => { case 2: return { - status: 200, + status: 200 as const, body: { + id: 2, name: "Lacy", breed: "border-collie", }, @@ -26,9 +31,10 @@ const findPetById: FindPetById = async ({params}, ctx) => { default: return { - status: 404, + status: 404 as const, body: { - error: 'not found', + code: 2, + message: 'not found', }, } } diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/models.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/models.ts index 5afb4ce93..e1560826e 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/models.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/models.ts @@ -2,6 +2,20 @@ /* tslint:disable */ /* eslint:disable */ +export type t_Error = { + code: number + message: string +} + +export type t_NewPet = { + name: string + tag?: string +} + +export type t_Pet = t_NewPet & { + id: number +} + export type t_AddPetBodySchema = { name: string tag?: string diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts index 796165771..27ef66942 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts @@ -4,14 +4,22 @@ import { t_DeleteTodoListByIdParamSchema, + t_Error, t_GetTodoListByIdParamSchema, t_GetTodoListsQuerySchema, + t_TodoList, t_UpdateTodoListByIdBodySchema, t_UpdateTodoListByIdParamSchema, } from "./models" import KoaRouter from "@koa/router" import { + Response, ServerConfig, + StatusCode, + StatusCode2xx, + StatusCode3xx, + StatusCode4xx, + StatusCode5xx, startServer, } from "@nahkies/typescript-koa-runtime/server" import { @@ -28,12 +36,16 @@ import { z } from "zod" export type GetTodoLists = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise> export type GetTodoListById = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_TodoList> + | Response + | Response +> export type UpdateTodoListById = ( params: Params< @@ -42,12 +54,20 @@ export type UpdateTodoListById = ( t_UpdateTodoListByIdBodySchema >, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<200, t_TodoList> + | Response + | Response +> export type DeleteTodoListById = ( params: Params, ctx: Context -) => Promise<{ status: number; body: any }> +) => Promise< + | Response<204, void> + | Response + | Response +> export type Implementation = { getTodoLists: GetTodoLists @@ -77,21 +97,24 @@ export function bootstrap( const { status, body } = await implementation.getTodoLists(input, ctx) - if (status === 200) { - ctx.body = z - .array( - z.object({ - id: z.coerce.string(), - name: z.coerce.string(), - totalItemCount: z.coerce.number(), - incompleteItemCount: z.coerce.number(), - created: z.coerce.string().datetime({ offset: true }), - updated: z.coerce.string().datetime({ offset: true }), - }) - ) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + )(status, body) ctx.status = status return next() }) @@ -107,26 +130,29 @@ export function bootstrap( const { status, body } = await implementation.getTodoListById(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.string(), - name: z.coerce.string(), - totalItemCount: z.coerce.number(), - incompleteItemCount: z.coerce.number(), - created: z.coerce.string().datetime({ offset: true }), - updated: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "4XX", + z.object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }), + ], + ], + z.void() + )(status, body) ctx.status = status return next() }) @@ -144,26 +170,29 @@ export function bootstrap( const { status, body } = await implementation.updateTodoListById(input, ctx) - if (status === 200) { - ctx.body = z - .object({ - id: z.coerce.string(), - name: z.coerce.string(), - totalItemCount: z.coerce.number(), - incompleteItemCount: z.coerce.number(), - created: z.coerce.string().datetime({ offset: true }), - updated: z.coerce.string().datetime({ offset: true }), - }) - .parse(body) - } else { - ctx.body = z - .object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }) - .parse(body) - } - + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }), + ], + [ + "4XX", + z.object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }), + ], + ], + z.void() + )(status, body) ctx.status = status return next() }) @@ -179,13 +208,19 @@ export function bootstrap( const { status, body } = await implementation.deleteTodoListById(input, ctx) - ctx.body = z - .object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }) - .parse(body) - + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "4XX", + z.object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), + }), + ], + ], + z.void() + )(status, body) ctx.status = status return next() }) diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/models.ts b/integration-tests/typescript-koa/src/todo-lists.yml/models.ts index 937a6dd44..c0f7376eb 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/models.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/models.ts @@ -2,6 +2,20 @@ /* tslint:disable */ /* eslint:disable */ +export type t_Error = { + code?: number + message?: string +} + +export type t_TodoList = { + created: string + id: string + incompleteItemCount: number + name: string + totalItemCount: number + updated: string +} + export type t_DeleteTodoListByIdParamSchema = { listId: string } diff --git a/packages/openapi-code-generator/src/typescript/common/output-utils.ts b/packages/openapi-code-generator/src/typescript/common/output-utils.ts index 27f865bff..fd93cd6e8 100644 --- a/packages/openapi-code-generator/src/typescript/common/output-utils.ts +++ b/packages/openapi-code-generator/src/typescript/common/output-utils.ts @@ -44,16 +44,16 @@ export async function emitGenerationResult(dest: string, units: CompilationUnit[ } async function formatOutput(raw: string): Promise { - // try { + try { return prettier.format(raw, { semi: false, arrowParens: "always", parser: "typescript", }) - // } catch (err){ - // logger.error("failed to prettier", {err}) - // return raw - // } + } catch (err){ + logger.error("failed to prettier", {err}) + return raw + } } async function writeOutput(folder: string, filename: string, data: string) { diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts index 68301fc1f..52bdb2068 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts @@ -67,6 +67,10 @@ export abstract class AbstractSchemaBuilder { } } + public abstract any(): string + + public abstract void(): string + protected abstract intersect(schemas: string[]): string protected abstract union(schemas: string[]): string diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts index 5f8634def..341b1310a 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts @@ -28,6 +28,15 @@ export class JoiBuilder extends AbstractSchemaBuilder { .add("parseRequestInput", "Params") } + public any(): string { + // TODO: implement + throw new Error("Method not implemented.") + } + public void(): string { + // TODO: implement + throw new Error("Method not implemented.") + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars protected intersect(schemas: string[]): string { // TODO: implement diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts index b005a0296..0a27afbe6 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts @@ -97,4 +97,18 @@ export class ZodBuilder extends AbstractSchemaBuilder { ].filter(isDefined).join(".") } + public any(): string { + return [ + this.zod, + "any()" + ].filter(isDefined).join(".") + } + + public void(): string { + return [ + this.zod, + "void()" + ].filter(isDefined).join(".") + } + } diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index cbc9495cf..7b30db80b 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -7,7 +7,6 @@ import { ModelBuilder } from "../common/model-builder" import { isDefined, titleCase } from "../../core/utils" import {SchemaBuilder, schemaBuilderFactory} from "./schema-builders/schema-builder" import {requestBodyAsParameter} from "../common/typescript-common" -import { ifElseIfBuilder } from "../common/typescript-common" function reduceParamsToOpenApiSchema(parameters: IRParameter[]): IRModelObject { return parameters.reduce((acc, parameter) => { @@ -49,7 +48,14 @@ export class ServerBuilder { this.imports = new ImportBuilder() // TODO: unsure why, but adding an export at `.` of index.ts doesn't work properly this.imports.from("@nahkies/typescript-koa-runtime/server") - .add("startServer", "ServerConfig") + .add("startServer", "ServerConfig", + "Response", + "StatusCode2xx", + "StatusCode3xx", + "StatusCode4xx", + "StatusCode5xx", + "StatusCode", + ) this.imports.from("koa") .add("Context") @@ -99,14 +105,48 @@ export class ServerBuilder { this.statements.push(`const ${ name } = ${ bodyParamSchema }`) } + const statusStringToType = (status: string) => { + if (/^\d+$/.test(status)) { + return status + } else if (/^\d[xX]{2}$/.test(status)) { + return `StatusCode${status[0]}xx` + } + throw new Error(`unexpected status string '${status}'`) + } + + const responseSchemas = Object.entries(operation.responses ?? {}).reduce((acc, [status, response]) => { + const content = Object.values(response.content ?? {}).pop() + + if(status === "default"){ + acc.defaultResponse = { + schema: content ? schemaBuilder.fromModel(content.schema, true) : schemaBuilder.void(), + type: content ? models.schemaObjectToType(content.schema) : "void", + } + } else { + acc.specific.push({ + statusString: status, + statusType: statusStringToType(status), + type: content ? models.schemaObjectToType(content.schema) : "void", + schema: content ? schemaBuilder.fromModel(content.schema, true) : schemaBuilder.void(), + }) + } + + return acc + }, {specific: [], defaultResponse: undefined} as {specific: {statusString: string, statusType: string, schema: string, type: string}[], defaultResponse?: { + type: string, schema: string + }}) this.operationTypeMap[operation.operationId] = ` export type ${titleCase(operation.operationId)} = ( params: Params<${ pathParamsType }, ${ queryParamsType }, ${ bodyParamsType + (bodyParamsType === "void" || bodyParamIsRequired ? "" : " | undefined") }>, ctx: Context - ) => Promise<{status: number, body: any}> + ) => Promise< + ${[ + ...responseSchemas.specific.map(it => `Response<${it.statusType}, ${it.type}>`), + responseSchemas.defaultResponse && `Response`, + ].filter(isDefined).join(" | ")} + > ` - this.statements.push([ `router.${ operation.method.toLowerCase() }('${ operation.operationId }','${ route(operation.route) }',`, `async (ctx, next) => { @@ -119,29 +159,9 @@ export class ServerBuilder { const {status, body} = await implementation.${operation.operationId}(input, ctx) - ${ - ifElseIfBuilder(Object.entries(operation.responses ?? []).map(([status, response]) => { - const content = Object.values(response.content ?? {}).pop() - - if (/^\d+$/.test(status) && content) { - return { - condition: `status === ${ status }`, - body: `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)`, - } - } else if (/^\dxx$/.test(status) && content) { - return { - condition: `status >= ${ status[0] }00 && status < ${ status[0] + 1 }00`, - body: `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)`, - } - } else if (content) { - return { - condition: undefined, - body: `ctx.body = ${ schemaBuilder.fromModel(content.schema, true) }.parse(body)`, - } - } - })) - } - + ctx.body = responseValidationFactory([${ + responseSchemas.specific.map(it => `["${it.statusString}", ${it.schema}]`)} + ], ${responseSchemas.defaultResponse?.schema})(status, body) ctx.status = status return next(); })`, diff --git a/packages/typescript-koa-runtime/src/server.ts b/packages/typescript-koa-runtime/src/server.ts index a34dd72f6..8c8651a19 100644 --- a/packages/typescript-koa-runtime/src/server.ts +++ b/packages/typescript-koa-runtime/src/server.ts @@ -4,6 +4,26 @@ import koaBody from "koa-body" import Router from "@koa/router" import {Server} from "http" +// from https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range +type Enumerate = Acc["length"] extends N + ? Acc[number] + : Enumerate + +type IntRange = F extends T ? + F : + Exclude, Enumerate> extends never ? + never : + Exclude, Enumerate> | T + +export type StatusCode1xx = IntRange<100,199> // `1${number}${number}` +export type StatusCode2xx = IntRange<200,299> // `2${number}${number}` +export type StatusCode3xx = IntRange<300,399> // `3${number}${number}` +export type StatusCode4xx = IntRange<400,499> // `4${number}${number}` +export type StatusCode5xx = IntRange<500,599> // `5${number}${number}` +export type StatusCode = StatusCode1xx | StatusCode2xx | StatusCode3xx | StatusCode4xx | StatusCode5xx + +export type Response = {status: Status, body: Type} + export type ServerConfig = { middleware?: Middleware[] router: Router diff --git a/packages/typescript-koa-runtime/src/zod.ts b/packages/typescript-koa-runtime/src/zod.ts index bf93f80ca..a198a1885 100644 --- a/packages/typescript-koa-runtime/src/zod.ts +++ b/packages/typescript-koa-runtime/src/zod.ts @@ -17,18 +17,28 @@ export function parseRequestInput( return schema?.parse(input) } -export function responseValidationFactory(possibleResponses: [string, z.ZodTypeAny][]) { - return (status: number, value: any) => { +export function responseValidationFactory(possibleResponses: [string, z.ZodTypeAny][], defaultResponse?: z.ZodTypeAny) { - for(const [match, schema] of possibleResponses) { + // Exploit the natural ordering matching the desired specificity of eg: 404 vs 4xx + possibleResponses.sort((x, y) => x[0] < y[0] ? -1 : 1) - const isMatch = match === "default" - || /^\\d+$/.test(match) && String(status) === match - || /^\\dxx$/.test(match) && String(status)[0] === match[0] + return (status: number, value: unknown) => { - if(isMatch) { + for (const [match, schema] of possibleResponses) { + + const isMatch = + /^\d+$/.test(match) && String(status) === match || + /^\d[xX]{2}$/.test(match) && String(status)[0] === match[0] + + if (isMatch) { return schema.parse(value) } } + + if (defaultResponse) { + return defaultResponse.parse(value) + } + + return value } } From 8aed680b5b4e9d7bb6b9448025662f5459ccb7ee Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 18:59:42 +0100 Subject: [PATCH 06/10] feat: split named schema's to seperate file reduces duplication and speeds validation of integration tests up by approximately 25% --- .../src/api.github.com.yaml/generated.ts | 100016 ++++----------- .../src/api.github.com.yaml/schemas.ts | 15376 +++ .../src/petstore-expanded.yml/generated.ts | 67 +- .../src/petstore-expanded.yml/schemas.ts | 17 + .../src/todo-lists.yml/generated.ts | 51 +- .../src/todo-lists.yml/schemas.ts | 21 + .../src/core/openapi-utils.ts | 4 +- .../src/typescript/common/model-builder.ts | 6 +- .../abstract-schema-builder.ts | 62 +- .../joi-schema-builder.spec.ts | 5 +- .../schema-builders/joi-schema-builder.ts | 7 +- .../schema-builders/schema-builder.ts | 14 +- .../zod-schema-builder.spec.ts | 5 +- .../schema-builders/zod-schema-builder.ts | 14 +- .../typescript-koa.generator.ts | 29 +- 15 files changed, 41102 insertions(+), 74592 deletions(-) create mode 100644 integration-tests/typescript-koa/src/api.github.com.yaml/schemas.ts create mode 100644 integration-tests/typescript-koa/src/petstore-expanded.yml/schemas.ts create mode 100644 integration-tests/typescript-koa/src/todo-lists.yml/schemas.ts diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts index 11af81b44..7f0960eba 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts @@ -1261,6 +1261,9 @@ import { t_actions_cache_list, t_actions_cache_usage_by_repository, t_actions_cache_usage_org_enterprise, + t_actions_can_approve_pull_request_reviews, + t_actions_default_workflow_permissions, + t_actions_enabled, t_actions_get_default_workflow_permissions, t_actions_organization_permissions, t_actions_public_key, @@ -1268,10 +1271,23 @@ import { t_actions_secret, t_actions_variable, t_actions_workflow_access_to_repository, + t_actor, + t_alert_created_at, + t_alert_dismissed_at, + t_alert_fixed_at, + t_alert_html_url, + t_alert_instances_url, + t_alert_number, + t_alert_updated_at, + t_alert_url, + t_allowed_actions, t_api_overview, + t_app_permissions, t_artifact, t_authentication_token, + t_author_association, t_authorization, + t_auto_merge, t_autolink, t_base_gist, t_basic_error, @@ -1287,13 +1303,37 @@ import { t_clone_traffic, t_code_frequency_stat, t_code_of_conduct, + t_code_of_conduct_simple, t_code_scanning_alert, + t_code_scanning_alert_classification, + t_code_scanning_alert_dismissed_comment, + t_code_scanning_alert_dismissed_reason, + t_code_scanning_alert_environment, t_code_scanning_alert_instance, t_code_scanning_alert_items, + t_code_scanning_alert_location, + t_code_scanning_alert_rule, + t_code_scanning_alert_rule_summary, + t_code_scanning_alert_set_state, + t_code_scanning_alert_severity, + t_code_scanning_alert_state, t_code_scanning_analysis, + t_code_scanning_analysis_analysis_key, + t_code_scanning_analysis_category, + t_code_scanning_analysis_commit_sha, + t_code_scanning_analysis_created_at, t_code_scanning_analysis_deletion, + t_code_scanning_analysis_environment, + t_code_scanning_analysis_sarif_file, + t_code_scanning_analysis_sarif_id, + t_code_scanning_analysis_tool, + t_code_scanning_analysis_tool_guid, + t_code_scanning_analysis_tool_name, + t_code_scanning_analysis_tool_version, + t_code_scanning_analysis_url, t_code_scanning_codeql_database, t_code_scanning_organization_alert_items, + t_code_scanning_ref, t_code_scanning_sarifs_receipt, t_code_scanning_sarifs_status, t_code_search_result_item, @@ -1323,6 +1363,9 @@ import { t_contributor, t_contributor_activity, t_dependabot_alert, + t_dependabot_alert_package, + t_dependabot_alert_security_advisory, + t_dependabot_alert_security_vulnerability, t_dependabot_alert_with_repository, t_dependabot_public_key, t_dependabot_secret, @@ -1330,10 +1373,14 @@ import { t_deploy_key, t_deployment, t_deployment_branch_policy, + t_deployment_branch_policy_settings, + t_deployment_reviewer_type, + t_deployment_simple, t_deployment_status, t_diff_entry, t_email, t_empty_object, + t_enabled_repositories, t_enterprise_security_analysis_settings, t_environment, t_environment_approvals, @@ -1343,6 +1390,7 @@ import { t_full_repository, t_gist_comment, t_gist_commit, + t_gist_history, t_gist_simple, t_git_commit, t_git_ref, @@ -1353,16 +1401,24 @@ import { t_hook, t_hook_delivery, t_hook_delivery_item, + t_hook_response, t_hovercard, t_import, t_installation, t_installation_token, t_integration, + t_interaction_expiry, + t_interaction_group, t_interaction_limit_response, t_issue, t_issue_comment, t_issue_event, + t_issue_event_dismissed_review, t_issue_event_for_issue, + t_issue_event_label, + t_issue_event_milestone, + t_issue_event_project_card, + t_issue_event_rename, t_issue_search_result_item, t_job, t_key, @@ -1373,12 +1429,32 @@ import { t_license, t_license_content, t_license_simple, + t_link, + t_link_with_type, + t_marketplace_account, t_marketplace_listing_plan, t_marketplace_purchase, t_merged_upstream, + t_metadata, t_migration, t_milestone, t_minimal_repository, + t_nullable_alert_updated_at, + t_nullable_code_of_conduct_simple, + t_nullable_codespace_machine, + t_nullable_collaborator, + t_nullable_community_health_file, + t_nullable_git_user, + t_nullable_integration, + t_nullable_issue, + t_nullable_license_simple, + t_nullable_milestone, + t_nullable_minimal_repository, + t_nullable_repository, + t_nullable_scoped_installation, + t_nullable_simple_commit, + t_nullable_simple_user, + t_nullable_team_simple, t_oidc_custom_sub, t_oidc_custom_sub_repo, t_org_hook, @@ -1398,6 +1474,8 @@ import { t_page_build_status, t_page_deployment, t_pages_health_check, + t_pages_https_certificate, + t_pages_source_hash, t_participation_stats, t_pending_deployment, t_porter_author, @@ -1410,15 +1488,20 @@ import { t_protected_branch, t_protected_branch_admin_enforced, t_protected_branch_pull_request_review, + t_protected_branch_required_status_check, t_public_user, t_pull_request, t_pull_request_merge_result, + t_pull_request_minimal, t_pull_request_review, t_pull_request_review_comment, t_pull_request_review_request, t_pull_request_simple, + t_rate_limit, t_rate_limit_overview, t_reaction, + t_reaction_rollup, + t_referenced_workflow, t_referrer_traffic, t_release, t_release_asset, @@ -1439,11 +1522,24 @@ import { t_runner_groups_org, t_runner_label, t_scim_error, + t_search_result_text_matches, t_secret_scanning_alert, + t_secret_scanning_alert_resolution, + t_secret_scanning_alert_resolution_comment, + t_secret_scanning_alert_state, t_secret_scanning_location, + t_secret_scanning_location_commit, + t_secret_scanning_location_issue_body, + t_secret_scanning_location_issue_comment, + t_secret_scanning_location_issue_title, + t_security_and_analysis, t_selected_actions, + t_selected_actions_url, t_short_blob, t_short_branch, + t_simple_commit, + t_simple_commit_status, + t_simple_repository, t_simple_user, t_ssh_signing_key, t_starred_repository, @@ -1456,6 +1552,7 @@ import { t_team_discussion_comment, t_team_full, t_team_membership, + t_team_organization, t_team_project, t_team_repository, t_team_simple, @@ -1464,17 +1561,203 @@ import { t_timeline_issue_events, t_topic, t_topic_search_result_item, + t_traffic, t_user_marketplace_purchase, t_user_search_result_item, t_validation_error, t_validation_error_simple, + t_verification, t_view_traffic, + t_wait_timer, t_webhook_config, + t_webhook_config_content_type, + t_webhook_config_insecure_ssl, + t_webhook_config_secret, + t_webhook_config_url, t_workflow, t_workflow_run, t_workflow_run_usage, t_workflow_usage, } from "./models" +import { + s_actions_billing_usage, + s_actions_cache_list, + s_actions_cache_usage_by_repository, + s_actions_cache_usage_org_enterprise, + s_actions_get_default_workflow_permissions, + s_actions_organization_permissions, + s_actions_public_key, + s_actions_repository_permissions, + s_actions_secret, + s_actions_set_default_workflow_permissions, + s_actions_variable, + s_actions_workflow_access_to_repository, + s_api_overview, + s_artifact, + s_authentication_token, + s_authorization, + s_autolink, + s_base_gist, + s_basic_error, + s_blob, + s_branch_protection, + s_branch_restriction_policy, + s_branch_with_protection, + s_check_run, + s_check_suite, + s_check_suite_preference, + s_clone_traffic, + s_code_of_conduct, + s_code_scanning_alert, + s_code_scanning_analysis_deletion, + s_code_scanning_codeql_database, + s_code_scanning_sarifs_receipt, + s_code_scanning_sarifs_status, + s_codeowners_errors, + s_codespace, + s_codespace_export_details, + s_codespace_with_full_repository, + s_codespaces_org_secret, + s_codespaces_public_key, + s_codespaces_secret, + s_codespaces_user_public_key, + s_combined_billing_usage, + s_combined_commit_status, + s_commit, + s_commit_comment, + s_commit_comparison, + s_community_profile, + s_content_directory, + s_content_file, + s_content_submodule, + s_content_symlink, + s_dependabot_alert, + s_dependabot_public_key, + s_dependabot_secret, + s_dependency_graph_diff, + s_deploy_key, + s_deployment, + s_deployment_branch_policy, + s_deployment_branch_policy_name_pattern, + s_deployment_status, + s_empty_object, + s_enterprise_security_analysis_settings, + s_environment, + s_feed, + s_file_commit, + s_full_repository, + s_gist_comment, + s_gist_simple, + s_git_commit, + s_git_ref, + s_git_tag, + s_git_tree, + s_gitignore_template, + s_gpg_key, + s_hook, + s_hook_delivery, + s_hovercard, + s_import, + s_installation, + s_installation_token, + s_integration, + s_interaction_limit, + s_interaction_limit_response, + s_issue, + s_issue_comment, + s_issue_event, + s_job, + s_key, + s_label, + s_language, + s_license, + s_license_content, + s_marketplace_purchase, + s_merged_upstream, + s_migration, + s_milestone, + s_minimal_repository, + s_oidc_custom_sub, + s_oidc_custom_sub_repo, + s_org_hook, + s_org_membership, + s_organization_actions_secret, + s_organization_actions_variable, + s_organization_dependabot_secret, + s_organization_full, + s_organization_invitation, + s_package, + s_package_version, + s_packages_billing_usage, + s_page, + s_page_build, + s_page_build_status, + s_page_deployment, + s_pages_health_check, + s_participation_stats, + s_porter_author, + s_private_user, + s_project, + s_project_card, + s_project_collaborator_permission, + s_project_column, + s_protected_branch, + s_protected_branch_admin_enforced, + s_protected_branch_pull_request_review, + s_public_user, + s_pull_request, + s_pull_request_merge_result, + s_pull_request_review, + s_pull_request_review_comment, + s_pull_request_review_request, + s_pull_request_simple, + s_rate_limit_overview, + s_reaction, + s_release, + s_release_asset, + s_release_notes_content, + s_repo_codespaces_secret, + s_repo_required_workflow, + s_repository, + s_repository_collaborator_permission, + s_repository_invitation, + s_repository_subscription, + s_required_workflow, + s_root, + s_runner, + s_runner_groups_enterprise, + s_runner_groups_org, + s_scim_error, + s_secret_scanning_alert, + s_secret_scanning_location_commit, + s_secret_scanning_location_issue_body, + s_secret_scanning_location_issue_comment, + s_secret_scanning_location_issue_title, + s_selected_actions, + s_short_blob, + s_snapshot, + s_ssh_signing_key, + s_status, + s_status_check_policy, + s_tag_protection, + s_team_discussion, + s_team_discussion_comment, + s_team_full, + s_team_membership, + s_team_project, + s_team_repository, + s_thread, + s_thread_subscription, + s_topic, + s_validation_error, + s_validation_error_simple, + s_view_traffic, + s_webhook_config, + s_workflow, + s_workflow_run, + s_workflow_run_usage, + s_workflow_usage, +} from "./schemas" import KoaRouter from "@koa/router" import { Response, @@ -11512,49 +11795,10 @@ export function bootstrap( const { status, body } = await implementation.metaRoot(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - current_user_url: z.coerce.string(), - current_user_authorizations_html_url: z.coerce.string(), - authorizations_url: z.coerce.string(), - code_search_url: z.coerce.string(), - commit_search_url: z.coerce.string(), - emails_url: z.coerce.string(), - emojis_url: z.coerce.string(), - events_url: z.coerce.string(), - feeds_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - hub_url: z.coerce.string(), - issue_search_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - label_search_url: z.coerce.string(), - notifications_url: z.coerce.string(), - organization_url: z.coerce.string(), - organization_repositories_url: z.coerce.string(), - organization_teams_url: z.coerce.string(), - public_gists_url: z.coerce.string(), - rate_limit_url: z.coerce.string(), - repository_url: z.coerce.string(), - repository_search_url: z.coerce.string(), - current_user_repositories_url: z.coerce.string(), - starred_url: z.coerce.string(), - starred_gists_url: z.coerce.string(), - topic_search_url: z.coerce.string().optional(), - user_url: z.coerce.string(), - user_organizations_url: z.coerce.string(), - user_repositories_url: z.coerce.string(), - user_search_url: z.coerce.string(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_root]], undefined)( + status, + body + ) ctx.status = status return next() }) @@ -11571,61 +11815,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_integration]], undefined)( + status, + body + ) ctx.status = status return next() }) @@ -11656,80 +11849,17 @@ export function bootstrap( [ [ "201", - z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + s_integration.merge( + z.object({ + client_id: z.coerce.string(), + client_secret: z.coerce.string(), + webhook_secret: z.coerce.string(), + pem: z.coerce.string(), }) - .merge( - z.object({ - client_id: z.coerce.string(), - client_secret: z.coerce.string(), - webhook_secret: z.coerce.string(), - pem: z.coerce.string(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), + ), ], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -11754,17 +11884,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }), - ], - ], + [["200", s_webhook_config]], undefined )(status, body) ctx.status = status @@ -11796,17 +11916,7 @@ export function bootstrap( await implementation.appsUpdateWebhookConfigForApp(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }), - ], - ], + [["200", s_webhook_config]], undefined )(status, body) ctx.status = status @@ -11858,40 +11968,8 @@ export function bootstrap( }) ), ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -11924,65 +12002,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - url: z.coerce.string().optional(), - request: z.object({ - headers: z.object({}), - payload: z.object({}), - }), - response: z.object({ - headers: z.object({}), - payload: z.coerce.string(), - }), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_hook_delivery], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -12014,40 +12036,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["202", z.object({})], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -12208,110 +12198,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_installation], + ["404", s_basic_error], ], undefined )(status, body) @@ -12345,15 +12233,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -12435,425 +12315,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - token: z.coerce.string(), - expires_at: z.coerce.string(), - permissions: z - .object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }) - .optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["201", s_installation_token], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -12887,15 +12353,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -12929,15 +12387,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -12975,29 +12425,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -13024,170 +12452,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z - .enum(["read", "write"]) - .optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_authorization], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -13214,161 +12481,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z - .enum(["read", "write"]) - .optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_authorization], + ["422", s_validation_error], ], undefined )(status, body) @@ -13398,29 +12512,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -13490,188 +12582,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - scopes: z.array(z.coerce.string()), - token: z.coerce.string(), - token_last_eight: z.coerce.string(), - hashed_token: z.coerce.string(), - app: z.object({ - client_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - note: z.coerce.string(), - note_url: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - fingerprint: z.coerce.string(), - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - installation: z - .object({ - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z - .enum(["read", "write"]) - .optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - repository_selection: z.enum(["all", "selected"]), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - repositories_url: z.coerce.string(), - account: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - .optional(), - expires_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_authorization], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -13693,74 +12608,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_integration], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -13826,26 +12676,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }), - ], + ["200", s_code_of_conduct], ["304", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -14006,23 +12839,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_organizations_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }), - ], - ], + [["201", s_runner_groups_enterprise]], undefined )(status, body) ctx.status = status @@ -14056,23 +12873,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_organizations_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }), - ], - ], + [["200", s_runner_groups_enterprise]], undefined )(status, body) ctx.status = status @@ -14218,15 +13019,7 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -14278,23 +13071,8 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -14327,28 +13105,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - advanced_security_enabled_for_new_repositories: - z.coerce.boolean(), - secret_scanning_enabled_for_new_repositories: z.coerce.boolean(), - secret_scanning_push_protection_enabled_for_new_repositories: - z.coerce.boolean(), - secret_scanning_push_protection_custom_link: z.coerce - .string() - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_enterprise_security_analysis_settings], + ["404", s_basic_error], ], undefined )(status, body) @@ -14400,15 +13158,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ["422", z.void()], ], undefined @@ -14636,32 +13386,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -14870,15 +13597,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], [ "503", z.object({ @@ -14928,15 +13647,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ["422", z.void()], ], undefined @@ -15712,15 +14423,7 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], [ "503", z.object({ @@ -15745,64 +14448,10 @@ export function bootstrap( const { status, body } = await implementation.activityGetFeeds(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - timeline_url: z.coerce.string(), - user_url: z.coerce.string(), - current_user_public_url: z.coerce.string().optional(), - current_user_url: z.coerce.string().optional(), - current_user_actor_url: z.coerce.string().optional(), - current_user_organization_url: z.coerce.string().optional(), - current_user_organization_urls: z - .array(z.coerce.string()) - .optional(), - security_advisories_url: z.coerce.string().optional(), - repository_discussions_url: z.coerce.string().optional(), - repository_discussions_category_url: z.coerce.string().optional(), - _links: z.object({ - timeline: z.object({ - href: z.coerce.string(), - type: z.coerce.string(), - }), - user: z.object({ - href: z.coerce.string(), - type: z.coerce.string(), - }), - security_advisories: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_public: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_actor: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_organization: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - current_user_organizations: z - .array( - z.object({ href: z.coerce.string(), type: z.coerce.string() }) - ) - .optional(), - repository_discussions: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - repository_discussions_category: z - .object({ href: z.coerce.string(), type: z.coerce.string() }) - .optional(), - }), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_feed]], undefined)( + status, + body + ) ctx.status = status return next() }) @@ -15898,15 +14547,7 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], ], undefined )(status, body) @@ -15931,278 +14572,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }), - ], + ["201", s_gist_simple], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -16301,38 +14675,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -16431,24 +14775,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -16469,236 +14797,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }), - ], + ["200", s_gist_simple], ["304", z.void()], [ "403", @@ -16714,15 +14813,7 @@ export function bootstrap( documentation_url: z.coerce.string().optional(), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -16748,268 +14839,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_gist_simple], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -17032,24 +14864,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -17128,24 +14944,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -17175,69 +14975,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], + ["201", s_gist_comment], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -17265,53 +15006,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ + ["200", s_gist_comment], + ["304", z.void()], [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - ["304", z.void()], - [ - "403", + "403", z.object({ block: z .object({ @@ -17324,15 +15022,7 @@ export function bootstrap( documentation_url: z.coerce.string().optional(), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -17365,59 +15055,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_gist_comment], + ["404", s_basic_error], ], undefined )(status, body) @@ -17450,24 +15089,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -17536,24 +15159,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -17817,24 +15424,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -17855,119 +15446,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }), - ], + ["201", s_base_gist], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -17998,15 +15481,7 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], ["404", z.object({})], ], undefined @@ -18031,24 +15506,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -18071,24 +15530,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -18112,277 +15555,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_gist_simple], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -18436,10 +15612,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ name: z.coerce.string(), source: z.coerce.string() }), - ], + ["200", s_gitignore_template], ["304", z.void()], ], undefined @@ -18781,24 +15954,8 @@ export function bootstrap( }), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -19428,38 +16585,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -19524,43 +16651,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - spdx_id: z.coerce.string(), - url: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - description: z.coerce.string(), - implementation: z.coerce.string(), - permissions: z.array(z.coerce.string()), - conditions: z.array(z.coerce.string()), - limitations: z.array(z.coerce.string()), - body: z.coerce.string(), - featured: z.coerce.boolean(), - }), - ], + ["200", s_license], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -19636,23 +16730,142 @@ export function bootstrap( const { status, body } = await implementation.appsGetSubscriptionPlanForAccount(input, ctx) + ctx.body = responseValidationFactory( + [ + ["200", s_marketplace_purchase], + ["401", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListPlansQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListPlans", + "/marketplace_listing/plans", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(appsListPlansQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.appsListPlans(input, ctx) + ctx.body = responseValidationFactory( [ [ "200", - z.object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ + z.array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ), + ], + ["401", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListAccountsForPlanParamSchema = z.object({ + plan_id: z.coerce.number(), + }) + + const appsListAccountsForPlanQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "appsListAccountsForPlan", + "/marketplace_listing/plans/:planId/accounts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsListAccountsForPlanParamSchema, + ctx.params + ), + query: parseRequestInput(appsListAccountsForPlanQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.appsListAccountsForPlan( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), plan: z .object({ url: z.coerce.string(), @@ -19670,54 +16883,13 @@ export function bootstrap( bullets: z.array(z.coerce.string()), }) .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + }), + }) + ), ], + ["401", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -19726,22 +16898,61 @@ export function bootstrap( } ) - const appsListPlansQuerySchema = z.object({ + const appsGetSubscriptionPlanForAccountStubbedParamSchema = z.object({ + account_id: z.coerce.number(), + }) + + router.get( + "appsGetSubscriptionPlanForAccountStubbed", + "/marketplace_listing/stubbed/accounts/:accountId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsGetSubscriptionPlanForAccountStubbedParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.appsGetSubscriptionPlanForAccountStubbed( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_marketplace_purchase], + ["401", s_basic_error], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const appsListPlansStubbedQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "appsListPlans", - "/marketplace_listing/plans", + "appsListPlansStubbed", + "/marketplace_listing/stubbed/plans", async (ctx, next) => { const input = { params: undefined, - query: parseRequestInput(appsListPlansQuerySchema, ctx.query), + query: parseRequestInput(appsListPlansStubbedQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.appsListPlans(input, ctx) + const { status, body } = await implementation.appsListPlansStubbed( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -19765,332 +16976,7 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsListAccountsForPlanParamSchema = z.object({ - plan_id: z.coerce.number(), - }) - - const appsListAccountsForPlanQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "appsListAccountsForPlan", - "/marketplace_listing/plans/:planId/accounts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsListAccountsForPlanParamSchema, - ctx.params - ), - query: parseRequestInput(appsListAccountsForPlanQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.appsListAccountsForPlan( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ - is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), - unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }), - }) - ), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsGetSubscriptionPlanForAccountStubbedParamSchema = z.object({ - account_id: z.coerce.number(), - }) - - router.get( - "appsGetSubscriptionPlanForAccountStubbed", - "/marketplace_listing/stubbed/accounts/:accountId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsGetSubscriptionPlanForAccountStubbedParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.appsGetSubscriptionPlanForAccountStubbed( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ - is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), - unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["404", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsListPlansStubbedQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "appsListPlansStubbed", - "/marketplace_listing/stubbed/plans", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(appsListPlansStubbedQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.appsListPlansStubbed( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - ), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], ], undefined )(status, body) @@ -20195,15 +17081,7 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], ], undefined )(status, body) @@ -20223,30 +17101,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - verifiable_password_authentication: z.coerce.boolean(), - ssh_key_fingerprints: z - .object({ - SHA256_RSA: z.coerce.string().optional(), - SHA256_DSA: z.coerce.string().optional(), - SHA256_ECDSA: z.coerce.string().optional(), - SHA256_ED25519: z.coerce.string().optional(), - }) - .optional(), - ssh_keys: z.array(z.coerce.string()).optional(), - hooks: z.array(z.coerce.string()).optional(), - web: z.array(z.coerce.string()).optional(), - api: z.array(z.coerce.string()).optional(), - git: z.array(z.coerce.string()).optional(), - packages: z.array(z.coerce.string()).optional(), - pages: z.array(z.coerce.string()).optional(), - importer: z.array(z.coerce.string()).optional(), - actions: z.array(z.coerce.string()).optional(), - dependabot: z.array(z.coerce.string()).optional(), - }), - ], + ["200", s_api_overview], ["304", z.void()], ], undefined @@ -21046,34 +17901,10 @@ export function bootstrap( }) ), ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["301", s_basic_error], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -21295,47 +18126,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -21372,24 +18165,8 @@ export function bootstrap( ["202", z.object({ message: z.coerce.string().optional() })], ["205", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -21419,205 +18196,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.string(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - subject: z.object({ - title: z.coerce.string(), - url: z.coerce.string(), - latest_comment_url: z.coerce.string(), - type: z.coerce.string(), - }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), - url: z.coerce.string(), - subscription_url: z.coerce.string(), - }), - ], + ["200", s_thread], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -21652,15 +18234,7 @@ export function bootstrap( [ ["205", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], ], undefined )(status, body) @@ -21694,37 +18268,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - thread_url: z.coerce.string().optional(), - repository_url: z.coerce.string().optional(), - }), - ], + ["200", s_thread_subscription], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -21762,37 +18309,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - thread_url: z.coerce.string().optional(), - repository_url: z.coerce.string().optional(), - }), - ], + ["200", s_thread_subscription], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -21825,24 +18345,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -21928,109 +18432,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - advanced_security_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_alerts_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_security_updates_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependency_graph_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_enabled_for_new_repositories: - z.coerce.boolean().optional(), - secret_scanning_push_protection_custom_link_enabled: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_custom_link: z.coerce - .string() - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_organization_full], + ["404", s_basic_error], ], undefined )(status, body) @@ -22103,139 +18506,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - advanced_security_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_alerts_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependabot_security_updates_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - dependency_graph_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_enabled_for_new_repositories: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_enabled_for_new_repositories: - z.coerce.boolean().optional(), - secret_scanning_push_protection_custom_link_enabled: z.coerce - .boolean() - .optional(), - secret_scanning_push_protection_custom_link: z.coerce - .string() - .optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.union([ - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ]), - ], + ["200", s_organization_full], + ["409", s_basic_error], + ["422", z.union([s_validation_error, s_validation_error_simple])], ], undefined )(status, body) @@ -22264,15 +18537,7 @@ export function bootstrap( await implementation.actionsGetActionsCacheUsageForOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_active_caches_count: z.coerce.number(), - total_active_caches_size_in_bytes: z.coerce.number(), - }), - ], - ], + [["200", s_actions_cache_usage_org_enterprise]], undefined )(status, body) ctx.status = status @@ -22352,7 +18617,7 @@ export function bootstrap( await implementation.oidcGetOidcCustomSubTemplateForOrg(input, ctx) ctx.body = responseValidationFactory( - [["200", z.object({ include_claim_keys: z.array(z.coerce.string()) })]], + [["200", s_oidc_custom_sub]], undefined )(status, body) ctx.status = status @@ -22364,9 +18629,7 @@ export function bootstrap( org: z.coerce.string(), }) - const oidcUpdateOidcCustomSubTemplateForOrgBodySchema = z.object({ - include_claim_keys: z.array(z.coerce.string()), - }) + const oidcUpdateOidcCustomSubTemplateForOrgBodySchema = s_oidc_custom_sub router.put( "oidcUpdateOidcCustomSubTemplateForOrg", @@ -22389,25 +18652,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - ["201", z.object({})], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["201", s_empty_object], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -22440,19 +18687,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - enabled_repositories: z.enum(["all", "none", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - allowed_actions: z - .enum(["all", "local_only", "selected"]) - .optional(), - selected_actions_url: z.coerce.string().optional(), - }), - ], - ], + [["200", s_actions_organization_permissions]], undefined )(status, body) ctx.status = status @@ -22968,16 +19203,7 @@ export function bootstrap( await implementation.actionsGetAllowedActionsOrganization(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }), - ], - ], + [["200", s_selected_actions]], undefined )(status, body) ctx.status = status @@ -22989,13 +19215,7 @@ export function bootstrap( org: z.coerce.string(), }) - const actionsSetAllowedActionsOrganizationBodySchema = z - .object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }) - .optional() + const actionsSetAllowedActionsOrganizationBodySchema = s_selected_actions router.put( "actionsSetAllowedActionsOrganization", @@ -23048,15 +19268,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - default_workflow_permissions: z.enum(["read", "write"]), - can_approve_pull_request_reviews: z.coerce.boolean(), - }), - ], - ], + [["200", s_actions_get_default_workflow_permissions]], undefined )(status, body) ctx.status = status @@ -23068,12 +19280,7 @@ export function bootstrap( z.object({ org: z.coerce.string() }) const actionsSetGithubActionsDefaultWorkflowPermissionsOrganizationBodySchema = - z - .object({ - default_workflow_permissions: z.enum(["read", "write"]).optional(), - can_approve_pull_request_reviews: z.coerce.boolean().optional(), - }) - .optional() + s_actions_set_default_workflow_permissions router.put( "actionsSetGithubActionsDefaultWorkflowPermissionsOrganization", @@ -23360,190 +19567,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["201", s_required_workflow], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -23576,184 +19601,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }), - ], - ], + [["200", s_required_workflow]], undefined )(status, body) ctx.status = status @@ -23792,262 +19640,80 @@ export function bootstrap( const { status, body } = await implementation.actionsUpdateRequiredWorkflow(input, ctx) + ctx.body = responseValidationFactory( + [ + ["200", s_required_workflow], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteRequiredWorkflowParamSchema = z.object({ + org: z.coerce.string(), + required_workflow_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteRequiredWorkflow", + "/orgs/:org/actions/required_workflows/:requiredWorkflowId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteRequiredWorkflowParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteRequiredWorkflow(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsListSelectedRepositoriesRequiredWorkflowParamSchema = z.object({ + org: z.coerce.string(), + required_workflow_id: z.coerce.number(), + }) + + router.get( + "actionsListSelectedRepositoriesRequiredWorkflow", + "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListSelectedRepositoriesRequiredWorkflowParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsListSelectedRepositoriesRequiredWorkflow( + input, + ctx + ) + ctx.body = responseValidationFactory( [ [ "200", z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsDeleteRequiredWorkflowParamSchema = z.object({ - org: z.coerce.string(), - required_workflow_id: z.coerce.number(), - }) - - router.delete( - "actionsDeleteRequiredWorkflow", - "/orgs/:org/actions/required_workflows/:requiredWorkflowId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteRequiredWorkflowParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsDeleteRequiredWorkflow(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsListSelectedRepositoriesRequiredWorkflowParamSchema = z.object({ - org: z.coerce.string(), - required_workflow_id: z.coerce.number(), - }) - - router.get( - "actionsListSelectedRepositoriesRequiredWorkflow", - "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListSelectedRepositoriesRequiredWorkflowParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsListSelectedRepositoriesRequiredWorkflow( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), @@ -24576,27 +20242,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce - .boolean() - .optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }), - ], - ], + [["201", s_runner_groups_org]], undefined )(status, body) ctx.status = status @@ -24626,27 +20272,7 @@ export function bootstrap( await implementation.actionsGetSelfHostedRunnerGroupForOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce - .boolean() - .optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }), - ], - ], + [["200", s_runner_groups_org]], undefined )(status, body) ctx.status = status @@ -24690,27 +20316,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce - .boolean() - .optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce.boolean().optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }), - ], - ], + [["200", s_runner_groups_org]], undefined )(status, body) ctx.status = status @@ -25332,323 +20938,7 @@ export function bootstrap( await implementation.actionsCreateRegistrationTokenForOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }), - ], - ], + [["201", s_authentication_token]], undefined )(status, body) ctx.status = status @@ -25677,323 +20967,7 @@ export function bootstrap( await implementation.actionsCreateRemoveTokenForOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }), - ], - ], + [["201", s_authentication_token]], undefined )(status, body) ctx.status = status @@ -26022,28 +20996,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_runner]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -26118,15 +21074,7 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -26181,23 +21129,8 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -26252,23 +21185,8 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -26314,15 +21232,7 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -26372,23 +21282,8 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -26465,19 +21360,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }), - ], - ], + [["200", s_actions_public_key]], undefined )(status, body) ctx.status = status @@ -26506,18 +21389,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }), - ], - ], + [["200", s_organization_actions_secret]], undefined )(status, body) ctx.status = status @@ -26558,7 +21430,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - ["201", z.object({})], + ["201", s_empty_object], ["204", z.void()], ], undefined @@ -26996,10 +21868,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [["201", s_empty_object]], + undefined + )(status, body) ctx.status = status return next() } @@ -27026,19 +21898,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }), - ], - ], + [["200", s_organization_actions_variable]], undefined )(status, body) ctx.status = status @@ -27517,15 +22377,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -27554,29 +22406,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -27819,15 +22649,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], [ "503", z.object({ @@ -28174,42 +22996,10 @@ export function bootstrap( }), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -28256,47 +23046,9 @@ export function bootstrap( ["204", z.void()], ["304", z.void()], ["400", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -28383,19 +23135,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }), - ], - ], + [["200", s_codespaces_public_key]], undefined )(status, body) ctx.status = status @@ -28427,18 +23167,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }), - ], - ], + [["200", s_codespaces_org_secret]], undefined )(status, body) ctx.status = status @@ -28479,40 +23208,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - ["201", z.object({})], + ["201", s_empty_object], ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -28547,15 +23246,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -28765,15 +23456,7 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -28813,15 +23496,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ["409", z.void()], ], undefined @@ -28856,39 +23531,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ["409", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -28925,39 +23570,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ["409", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -29186,43 +23801,10 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -29309,12 +23891,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ key_id: z.coerce.string(), key: z.coerce.string() }), - ], - ], + [["200", s_dependabot_public_key]], undefined )(status, body) ctx.status = status @@ -29346,18 +23923,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }), - ], - ], + [["200", s_organization_dependabot_secret]], undefined )(status, body) ctx.status = status @@ -29398,7 +23964,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - ["201", z.object({})], + ["201", s_empty_object], ["204", z.void()], ], undefined @@ -30630,15 +25196,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -30688,15 +25246,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -30731,59 +25281,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ - url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["201", s_org_hook], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -30810,36 +25310,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ - url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_org_hook], + ["404", s_basic_error], ], undefined )(status, body) @@ -30886,59 +25358,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ - url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_org_hook], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -30970,15 +25392,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -31011,17 +25425,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }), - ], - ], + [["200", s_webhook_config]], undefined )(status, body) ctx.status = status @@ -31063,17 +25467,7 @@ export function bootstrap( await implementation.orgsUpdateWebhookConfigForOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }), - ], - ], + [["200", s_webhook_config]], undefined )(status, body) ctx.status = status @@ -31133,40 +25527,8 @@ export function bootstrap( }) ), ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -31201,65 +25563,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - url: z.coerce.string().optional(), - request: z.object({ - headers: z.object({}), - payload: z.object({}), - }), - response: z.object({ - headers: z.object({}), - payload: z.coerce.string(), - }), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_hook_delivery], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -31293,40 +25599,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["202", z.object({})], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -31355,15 +25629,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -31393,103 +25659,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }), - ], - ], + [["200", s_installation]], undefined )(status, body) ctx.status = status @@ -31674,16 +25844,7 @@ export function bootstrap( org: z.coerce.string(), }) - const interactionsSetRestrictionsForOrgBodySchema = z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - expiry: z - .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) - .optional(), - }) + const interactionsSetRestrictionsForOrgBodySchema = s_interaction_limit router.put( "interactionsSetRestrictionsForOrg", @@ -31706,41 +25867,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - origin: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_interaction_limit_response], + ["422", s_validation_error], ], undefined )(status, body) @@ -31851,15 +25979,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -31896,77 +26016,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["201", s_organization_invitation], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -31998,38 +26050,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -32109,15 +26131,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -32722,15 +26736,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -32786,29 +26792,7 @@ export function bootstrap( }) ), ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -32872,15 +26856,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], ], undefined )(status, body) @@ -33220,42 +27196,10 @@ export function bootstrap( }), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -33290,42 +27234,10 @@ export function bootstrap( [ ["202", z.object({})], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -33356,640 +27268,163 @@ export function bootstrap( const { status, body } = await implementation.codespacesStopInOrganization(input, ctx) + ctx.body = responseValidationFactory( + [ + ["200", s_codespace], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsGetMembershipForUserParamSchema = z.object({ + org: z.coerce.string(), + username: z.coerce.string(), + }) + + router.get( + "orgsGetMembershipForUser", + "/orgs/:org/memberships/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsGetMembershipForUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.orgsGetMembershipForUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsSetMembershipForUserParamSchema = z.object({ + org: z.coerce.string(), + username: z.coerce.string(), + }) + + const orgsSetMembershipForUserBodySchema = z + .object({ role: z.enum(["admin", "member"]).optional() }) + .optional() + + router.put( + "orgsSetMembershipForUser", + "/orgs/:org/memberships/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsSetMembershipForUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(orgsSetMembershipForUserBodySchema, ctx.body), + } + + const { status, body } = await implementation.orgsSetMembershipForUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsRemoveMembershipForUserParamSchema = z.object({ + org: z.coerce.string(), + username: z.coerce.string(), + }) + + router.delete( + "orgsRemoveMembershipForUser", + "/orgs/:org/memberships/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsRemoveMembershipForUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.orgsRemoveMembershipForUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsListForOrgParamSchema = z.object({ org: z.coerce.string() }) + + const migrationsListForOrgQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + exclude: z.array(z.enum(["repositories"])).optional(), + }) + + router.get( + "migrationsListForOrg", + "/orgs/:org/migrations", + async (ctx, next) => { + const input = { + params: parseRequestInput(migrationsListForOrgParamSchema, ctx.params), + query: parseRequestInput(migrationsListForOrgQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.migrationsListForOrg( + input, + ctx + ) + ctx.body = responseValidationFactory( [ [ "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsGetMembershipForUserParamSchema = z.object({ - org: z.coerce.string(), - username: z.coerce.string(), - }) - - router.get( - "orgsGetMembershipForUser", - "/orgs/:org/memberships/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsGetMembershipForUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.orgsGetMembershipForUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsSetMembershipForUserParamSchema = z.object({ - org: z.coerce.string(), - username: z.coerce.string(), - }) - - const orgsSetMembershipForUserBodySchema = z - .object({ role: z.enum(["admin", "member"]).optional() }) - .optional() - - router.put( - "orgsSetMembershipForUser", - "/orgs/:org/memberships/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsSetMembershipForUserParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(orgsSetMembershipForUserBodySchema, ctx.body), - } - - const { status, body } = await implementation.orgsSetMembershipForUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsRemoveMembershipForUserParamSchema = z.object({ - org: z.coerce.string(), - username: z.coerce.string(), - }) - - router.delete( - "orgsRemoveMembershipForUser", - "/orgs/:org/memberships/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsRemoveMembershipForUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.orgsRemoveMembershipForUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsListForOrgParamSchema = z.object({ org: z.coerce.string() }) - - const migrationsListForOrgQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - exclude: z.array(z.enum(["repositories"])).optional(), - }) - - router.get( - "migrationsListForOrg", - "/orgs/:org/migrations", - async (ctx, next) => { - const input = { - params: parseRequestInput(migrationsListForOrgParamSchema, ctx.params), - query: parseRequestInput(migrationsListForOrgQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.migrationsListForOrg( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ + z.array( + z.object({ id: z.coerce.number(), owner: z.object({ name: z.coerce.string().optional(), @@ -34374,383 +27809,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["201", s_migration], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -34789,541 +27850,165 @@ export function bootstrap( ctx ) + ctx.body = responseValidationFactory( + [ + ["200", s_migration], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsDownloadArchiveForOrgParamSchema = z.object({ + org: z.coerce.string(), + migration_id: z.coerce.number(), + }) + + router.get( + "migrationsDownloadArchiveForOrg", + "/orgs/:org/migrations/:migrationId/archive", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsDownloadArchiveForOrgParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.migrationsDownloadArchiveForOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["302", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsDeleteArchiveForOrgParamSchema = z.object({ + org: z.coerce.string(), + migration_id: z.coerce.number(), + }) + + router.delete( + "migrationsDeleteArchiveForOrg", + "/orgs/:org/migrations/:migrationId/archive", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsDeleteArchiveForOrgParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.migrationsDeleteArchiveForOrg(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsUnlockRepoForOrgParamSchema = z.object({ + org: z.coerce.string(), + migration_id: z.coerce.number(), + repo_name: z.coerce.string(), + }) + + router.delete( + "migrationsUnlockRepoForOrg", + "/orgs/:org/migrations/:migrationId/repos/:repoName/lock", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsUnlockRepoForOrgParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.migrationsUnlockRepoForOrg( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsListReposForOrgParamSchema = z.object({ + org: z.coerce.string(), + migration_id: z.coerce.number(), + }) + + const migrationsListReposForOrgQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "migrationsListReposForOrg", + "/orgs/:org/migrations/:migrationId/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsListReposForOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + migrationsListReposForOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.migrationsListReposForOrg( + input, + ctx + ) + ctx.body = responseValidationFactory( [ [ "200", - z.object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsDownloadArchiveForOrgParamSchema = z.object({ - org: z.coerce.string(), - migration_id: z.coerce.number(), - }) - - router.get( - "migrationsDownloadArchiveForOrg", - "/orgs/:org/migrations/:migrationId/archive", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsDownloadArchiveForOrgParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.migrationsDownloadArchiveForOrg(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["302", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsDeleteArchiveForOrgParamSchema = z.object({ - org: z.coerce.string(), - migration_id: z.coerce.number(), - }) - - router.delete( - "migrationsDeleteArchiveForOrg", - "/orgs/:org/migrations/:migrationId/archive", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsDeleteArchiveForOrgParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.migrationsDeleteArchiveForOrg(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsUnlockRepoForOrgParamSchema = z.object({ - org: z.coerce.string(), - migration_id: z.coerce.number(), - repo_name: z.coerce.string(), - }) - - router.delete( - "migrationsUnlockRepoForOrg", - "/orgs/:org/migrations/:migrationId/repos/:repoName/lock", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsUnlockRepoForOrgParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.migrationsUnlockRepoForOrg( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsListReposForOrgParamSchema = z.object({ - org: z.coerce.string(), - migration_id: z.coerce.number(), - }) - - const migrationsListReposForOrgQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "migrationsListReposForOrg", - "/orgs/:org/migrations/:migrationId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsListReposForOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - migrationsListReposForOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.migrationsListReposForOrg( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), avatar_url: z.coerce.string(), @@ -35479,15 +28164,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -35596,15 +28273,7 @@ export function bootstrap( ["202", z.object({})], ["204", z.void()], ["403", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -35901,24 +28570,8 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -35956,221 +28609,10 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageForOrganization(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_package]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -36210,33 +28652,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -36284,33 +28702,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -36404,33 +28798,9 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -36473,44 +28843,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }), - ], - ], + [["200", s_package_version]], undefined )(status, body) ctx.status = status @@ -36551,33 +28884,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -36619,33 +28928,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -36719,14 +29004,7 @@ export function bootstrap( }) ), ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -36758,94 +29036,12 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["201", s_project], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -36974,15 +29170,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], ], undefined )(status, body) @@ -37265,381 +29453,52 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const secretScanningListAlertsForOrgParamSchema = z.object({ - org: z.coerce.string(), - }) - - const secretScanningListAlertsForOrgQuerySchema = z.object({ - state: z.enum(["open", "resolved"]).optional(), - secret_type: z.coerce.string().optional(), - resolution: z.coerce.string().optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - }) - - router.get( - "secretScanningListAlertsForOrg", - "/orgs/:org/secret-scanning/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningListAlertsForOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListAlertsForOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.secretScanningListAlertsForOrg(input, ctx) - - ctx.body = responseValidationFactory( + ["201", s_repository], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const secretScanningListAlertsForOrgParamSchema = z.object({ + org: z.coerce.string(), + }) + + const secretScanningListAlertsForOrgQuerySchema = z.object({ + state: z.enum(["open", "resolved"]).optional(), + secret_type: z.coerce.string().optional(), + resolution: z.coerce.string().optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + }) + + router.get( + "secretScanningListAlertsForOrg", + "/orgs/:org/secret-scanning/alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningListAlertsForOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + secretScanningListAlertsForOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.secretScanningListAlertsForOrg(input, ctx) + + ctx.body = responseValidationFactory( [ [ "200", @@ -37805,15 +29664,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], [ "503", z.object({ @@ -37965,33 +29816,7 @@ export function bootstrap( await implementation.billingGetGithubActionsBillingOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_minutes_used: z.coerce.number(), - total_paid_minutes_used: z.coerce.number(), - included_minutes: z.coerce.number(), - minutes_used_breakdown: z.object({ - UBUNTU: z.coerce.number().optional(), - MACOS: z.coerce.number().optional(), - WINDOWS: z.coerce.number().optional(), - ubuntu_4_core: z.coerce.number().optional(), - ubuntu_8_core: z.coerce.number().optional(), - ubuntu_16_core: z.coerce.number().optional(), - ubuntu_32_core: z.coerce.number().optional(), - ubuntu_64_core: z.coerce.number().optional(), - windows_4_core: z.coerce.number().optional(), - windows_8_core: z.coerce.number().optional(), - windows_16_core: z.coerce.number().optional(), - windows_32_core: z.coerce.number().optional(), - windows_64_core: z.coerce.number().optional(), - macos_12_core: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }), - }), - ], - ], + [["200", s_actions_billing_usage]], undefined )(status, body) ctx.status = status @@ -38020,16 +29845,7 @@ export function bootstrap( await implementation.billingGetGithubPackagesBillingOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_gigabytes_bandwidth_used: z.coerce.number(), - total_paid_gigabytes_bandwidth_used: z.coerce.number(), - included_gigabytes_bandwidth: z.coerce.number(), - }), - ], - ], + [["200", s_packages_billing_usage]], undefined )(status, body) ctx.status = status @@ -38058,16 +29874,7 @@ export function bootstrap( await implementation.billingGetSharedStorageBillingOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - days_left_in_billing_cycle: z.coerce.number(), - estimated_paid_storage_for_month: z.coerce.number(), - estimated_storage_for_month: z.coerce.number(), - }), - ], - ], + [["200", s_combined_billing_usage]], undefined )(status, body) ctx.status = status @@ -38134,15 +29941,7 @@ export function bootstrap( }) ), ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], ], undefined )(status, body) @@ -38173,143 +29972,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["201", s_team_full], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -38336,120 +30001,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_team_full], + ["404", s_basic_error], ], undefined )(status, body) @@ -38487,257 +30040,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_team_full], + ["201", s_team_full], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -38905,66 +30212,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - ], + [["201", s_team_discussion]], undefined )(status, body) ctx.status = status @@ -38997,66 +30245,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - ], + [["200", s_team_discussion]], undefined )(status, body) ctx.status = status @@ -39096,66 +30285,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - ], + [["200", s_team_discussion]], undefined )(status, body) ctx.status = status @@ -39322,61 +30452,7 @@ export function bootstrap( await implementation.teamsCreateDiscussionCommentInOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - ], + [["201", s_team_discussion_comment]], undefined )(status, body) ctx.status = status @@ -39408,61 +30484,7 @@ export function bootstrap( await implementation.teamsGetDiscussionCommentInOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - ], + [["200", s_team_discussion_comment]], undefined )(status, body) ctx.status = status @@ -39501,61 +30523,7 @@ export function bootstrap( await implementation.teamsUpdateDiscussionCommentInOrg(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - ], + [["200", s_team_discussion_comment]], undefined )(status, body) ctx.status = status @@ -39738,88 +30706,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_reaction], + ["201", s_reaction], ], undefined )(status, body) @@ -39996,88 +30884,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_reaction], + ["201", s_reaction], ], undefined )(status, body) @@ -40286,14 +31094,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }), - ], + ["200", s_team_membership], ["404", z.void()], ], undefined @@ -40334,14 +31135,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }), - ], + ["200", s_team_membership], ["403", z.void()], ["422", z.void()], ], @@ -40497,53 +31291,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), - }), - ], + ["200", s_team_project], ["404", z.void()], ], undefined @@ -40860,438 +31608,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - }), - ], + ["200", s_team_repository], ["204", z.void()], ["404", z.void()], ], @@ -41508,74 +31825,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }), - ], + ["200", s_project_card], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -41610,82 +31864,12 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }), - ], + ["200", s_project_card], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -41715,15 +31899,7 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], [ "403", z.object({ @@ -41732,15 +31908,7 @@ export function bootstrap( errors: z.array(z.coerce.string()).optional(), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -41772,15 +31940,7 @@ export function bootstrap( [ ["201", z.object({})], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], [ "403", z.object({ @@ -41798,29 +31958,7 @@ export function bootstrap( .optional(), }), ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], [ "503", z.object({ @@ -41866,47 +32004,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_project_column], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -41938,38 +32040,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_project_column], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -42001,24 +32075,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -42097,24 +32155,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -42152,95 +32194,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }), - ], + ["201", s_project_card], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.union([ - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ]), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", z.union([s_validation_error, s_validation_error_simple])], [ "503", z.object({ @@ -42290,32 +32248,9 @@ export function bootstrap( [ ["201", z.object({})], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -42337,69 +32272,10 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }), - ], + ["200", s_project], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -42432,60 +32308,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }), - ], + ["200", s_project], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], [ "403", z.object({ @@ -42495,23 +32320,8 @@ export function bootstrap( }), ], ["404", z.void()], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["410", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -42534,15 +32344,7 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], [ "403", z.object({ @@ -42551,24 +32353,8 @@ export function bootstrap( errors: z.array(z.coerce.string()).optional(), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], + ["410", s_basic_error], ], undefined )(status, body) @@ -42638,56 +32424,10 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -42727,56 +32467,10 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -42812,56 +32506,10 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -42893,86 +32541,12 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - permission: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - ], + ["200", s_project_collaborator_permission], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -43023,24 +32597,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -43072,46 +32630,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["201", s_project_column], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -43131,97 +32654,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - resources: z.object({ - core: z.object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }), - graphql: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - search: z.object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }), - source_import: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - integration_manifest: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - code_scanning_upload: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - actions_runner_registration: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - scim: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - dependency_snapshots: z - .object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }) - .optional(), - }), - rate: z.object({ - limit: z.coerce.number(), - remaining: z.coerce.number(), - reset: z.coerce.number(), - used: z.coerce.number(), - }), - }), - ], + ["200", s_rate_limit_overview], ["304", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -43442,15 +32877,7 @@ export function bootstrap( ), }), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -43483,192 +32910,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum(["active", "deleted"]), - source_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_repo_required_workflow], + ["404", s_basic_error], ], undefined )(status, body) @@ -43701,31 +32944,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - billable: z.object({ - UBUNTU: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - MACOS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - WINDOWS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_workflow_usage], + ["404", s_basic_error], ], undefined )(status, body) @@ -43750,1882 +32970,1157 @@ export function bootstrap( ctx.body = responseValidationFactory( [ + ["200", s_full_repository], + ["301", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposUpdateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposUpdateBodySchema = z + .object({ + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + visibility: z.enum(["public", "private"]).optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.coerce.string().optional() }) + .optional(), + secret_scanning: z + .object({ status: z.coerce.string().optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.coerce.string().optional() }) + .optional(), + }) + .optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + default_branch: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + archived: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }) + .optional() + + router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { + const input = { + params: parseRequestInput(reposUpdateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdate(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_full_repository], + ["307", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposDeleteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete("reposDelete", "/repos/:owner/:repo", async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDelete(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["307", s_basic_error], [ - "200", + "403", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const actionsListArtifactsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsListArtifactsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + name: z.coerce.string().optional(), + }) + + router.get( + "actionsListArtifactsForRepo", + "/repos/:owner/:repo/actions/artifacts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListArtifactsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListArtifactsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.actionsListArtifactsForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }), + ], ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const reposUpdateParamSchema = z.object({ + const actionsGetArtifactParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + artifact_id: z.coerce.number(), }) - const reposUpdateBodySchema = z - .object({ - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - visibility: z.enum(["public", "private"]).optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ status: z.coerce.string().optional() }) - .optional(), - secret_scanning: z - .object({ status: z.coerce.string().optional() }) - .optional(), - secret_scanning_push_protection: z - .object({ status: z.coerce.string().optional() }) - .optional(), - }) - .optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - default_branch: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), - archived: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }) + router.get( + "actionsGetArtifact", + "/repos/:owner/:repo/actions/artifacts/:artifactId", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsGetArtifactParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetArtifact( + input, + ctx + ) + + ctx.body = responseValidationFactory([["200", s_artifact]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsDeleteArtifactParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + artifact_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteArtifact", + "/repos/:owner/:repo/actions/artifacts/:artifactId", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsDeleteArtifactParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsDeleteArtifact( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsDownloadArtifactParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + artifact_id: z.coerce.number(), + archive_format: z.coerce.string(), + }) + + router.get( + "actionsDownloadArtifact", + "/repos/:owner/:repo/actions/artifacts/:artifactId/:archiveFormat", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDownloadArtifactParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsDownloadArtifact( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["302", z.void()], + ["410", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetActionsCacheUsageParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "actionsGetActionsCacheUsage", + "/repos/:owner/:repo/actions/cache/usage", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetActionsCacheUsageParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetActionsCacheUsage( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_actions_cache_usage_by_repository]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetActionsCacheListParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsGetActionsCacheListQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + sort: z + .enum(["created_at", "last_accessed_at", "size_in_bytes"]) + .optional(), + direction: z.enum(["asc", "desc"]).optional(), + }) + + router.get( + "actionsGetActionsCacheList", + "/repos/:owner/:repo/actions/caches", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetActionsCacheListParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsGetActionsCacheListQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.actionsGetActionsCacheList( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_actions_cache_list]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteActionsCacheByKeyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsDeleteActionsCacheByKeyQuerySchema = z.object({ + key: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + + router.delete( + "actionsDeleteActionsCacheByKey", + "/repos/:owner/:repo/actions/caches", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteActionsCacheByKeyParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsDeleteActionsCacheByKeyQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteActionsCacheByKey(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_actions_cache_list]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteActionsCacheByIdParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + cache_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteActionsCacheById", + "/repos/:owner/:repo/actions/caches/:cacheId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteActionsCacheByIdParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteActionsCacheById(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetJobForWorkflowRunParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + job_id: z.coerce.number(), + }) + + router.get( + "actionsGetJobForWorkflowRun", + "/repos/:owner/:repo/actions/jobs/:jobId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetJobForWorkflowRunParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetJobForWorkflowRun( + input, + ctx + ) + + ctx.body = responseValidationFactory([["200", s_job]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsDownloadJobLogsForWorkflowRunParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + job_id: z.coerce.number(), + }) + + router.get( + "actionsDownloadJobLogsForWorkflowRun", + "/repos/:owner/:repo/actions/jobs/:jobId/logs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDownloadJobLogsForWorkflowRunParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) + + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsReRunJobForWorkflowRunParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + job_id: z.coerce.number(), + }) + + const actionsReRunJobForWorkflowRunBodySchema = z + .object({ enable_debug_logging: z.coerce.boolean().optional() }) .optional() - router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateBodySchema, ctx.body), + router.post( + "actionsReRunJobForWorkflowRun", + "/repos/:owner/:repo/actions/jobs/:jobId/rerun", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsReRunJobForWorkflowRunParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsReRunJobForWorkflowRunBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsReRunJobForWorkflowRun(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.reposUpdate(input, ctx) + const actionsGetCustomOidcSubClaimForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) - ctx.body = responseValidationFactory( - [ + router.get( + "actionsGetCustomOidcSubClaimForRepo", + "/repos/:owner/:repo/actions/oidc/customization/sub", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetCustomOidcSubClaimForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetCustomOidcSubClaimForRepo(input, ctx) + + ctx.body = responseValidationFactory( [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), + ["200", s_oidc_custom_sub_repo], + ["400", s_scim_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetCustomOidcSubClaimForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsSetCustomOidcSubClaimForRepoBodySchema = s_oidc_custom_sub_repo + + router.put( + "actionsSetCustomOidcSubClaimForRepo", + "/repos/:owner/:repo/actions/oidc/customization/sub", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetCustomOidcSubClaimForRepoParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetCustomOidcSubClaimForRepoBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetCustomOidcSubClaimForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_empty_object], + ["400", s_scim_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetGithubActionsPermissionsRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "actionsGetGithubActionsPermissionsRepository", + "/repos/:owner/:repo/actions/permissions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetGithubActionsPermissionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetGithubActionsPermissionsRepository( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_actions_repository_permissions]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetGithubActionsPermissionsRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsSetGithubActionsPermissionsRepositoryBodySchema = z.object({ + enabled: z.coerce.boolean(), + allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), + }) + + router.put( + "actionsSetGithubActionsPermissionsRepository", + "/repos/:owner/:repo/actions/permissions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetGithubActionsPermissionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetGithubActionsPermissionsRepositoryBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetGithubActionsPermissionsRepository( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetWorkflowAccessToRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "actionsGetWorkflowAccessToRepository", + "/repos/:owner/:repo/actions/permissions/access", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetWorkflowAccessToRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetWorkflowAccessToRepository(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_actions_workflow_access_to_repository]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetWorkflowAccessToRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsSetWorkflowAccessToRepositoryBodySchema = + s_actions_workflow_access_to_repository + + router.put( + "actionsSetWorkflowAccessToRepository", + "/repos/:owner/:repo/actions/permissions/access", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetWorkflowAccessToRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetWorkflowAccessToRepositoryBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetWorkflowAccessToRepository(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetAllowedActionsRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "actionsGetAllowedActionsRepository", + "/repos/:owner/:repo/actions/permissions/selected-actions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetAllowedActionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetAllowedActionsRepository(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_selected_actions]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetAllowedActionsRepositoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsSetAllowedActionsRepositoryBodySchema = s_selected_actions + + router.put( + "actionsSetAllowedActionsRepository", + "/repos/:owner/:repo/actions/permissions/selected-actions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetAllowedActionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetAllowedActionsRepositoryBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetAllowedActionsRepository(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = + z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + + router.get( + "actionsGetGithubActionsDefaultWorkflowPermissionsRepository", + "/repos/:owner/:repo/actions/permissions/workflow", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetGithubActionsDefaultWorkflowPermissionsRepository( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_actions_get_default_workflow_permissions]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = + z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + + const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema = + s_actions_set_default_workflow_permissions + + router.put( + "actionsSetGithubActionsDefaultWorkflowPermissionsRepository", + "/repos/:owner/:repo/actions/permissions/workflow", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsSetGithubActionsDefaultWorkflowPermissionsRepository( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsListRequiredWorkflowRunsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + required_workflow_id_for_repo: z.coerce.number(), + }) + + const actionsListRequiredWorkflowRunsQuerySchema = z.object({ + actor: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + event: z.coerce.string().optional(), + status: z + .enum([ + "completed", + "action_required", + "cancelled", + "failure", + "neutral", + "skipped", + "stale", + "success", + "timed_out", + "in_progress", + "queued", + "requested", + "waiting", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + created: z.coerce.string().datetime({ offset: true }).optional(), + exclude_pull_requests: z.coerce.boolean().optional(), + check_suite_id: z.coerce.number().optional(), + head_sha: z.coerce.string().optional(), + }) + + router.get( + "actionsListRequiredWorkflowRuns", + "/repos/:owner/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/runs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListRequiredWorkflowRunsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListRequiredWorkflowRunsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListRequiredWorkflowRuns(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), clone_url: z.coerce.string().optional(), mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), svn_url: z.coerce.string().optional(), homepage: z.coerce.string().optional(), language: z.coerce.string().optional(), @@ -45642,12 +34137,22 @@ export function bootstrap( has_wiki: z.coerce.boolean().optional(), has_pages: z.coerce.boolean().optional(), has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), archived: z.coerce.boolean().optional(), disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), permissions: z .object({ admin: z.coerce.boolean().optional(), @@ -45657,276 +34162,127 @@ export function bootstrap( pull: z.coerce.boolean().optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), + role_name: z.coerce.string().optional(), temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + }), + head_repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), clone_url: z.coerce.string().optional(), mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), svn_url: z.coerce.string().optional(), homepage: z.coerce.string().optional(), language: z.coerce.string().optional(), @@ -45943,12 +34299,22 @@ export function bootstrap( has_wiki: z.coerce.boolean().optional(), has_pages: z.coerce.boolean().optional(), has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), archived: z.coerce.boolean().optional(), disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), permissions: z .object({ admin: z.coerce.boolean().optional(), @@ -45958,233 +34324,96 @@ export function bootstrap( pull: z.coerce.boolean().optional(), }) .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), + role_name: z.coerce.string().optional(), temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - ], - [ - "307", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }), + ], ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const reposDeleteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete("reposDelete", "/repos/:owner/:repo", async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteParamSchema, ctx.params), - query: undefined, - body: undefined, + undefined + )(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.reposDelete(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "307", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const actionsListArtifactsForRepoParamSchema = z.object({ + const actionsListSelfHostedRunnersForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const actionsListArtifactsForRepoQuerySchema = z.object({ + const actionsListSelfHostedRunnersForRepoQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - name: z.coerce.string().optional(), }) router.get( - "actionsListArtifactsForRepo", - "/repos/:owner/:repo/actions/artifacts", + "actionsListSelfHostedRunnersForRepo", + "/repos/:owner/:repo/actions/runners", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListArtifactsForRepoParamSchema, + actionsListSelfHostedRunnersForRepoParamSchema, ctx.params ), query: parseRequestInput( - actionsListArtifactsForRepoQuerySchema, + actionsListSelfHostedRunnersForRepoQuerySchema, ctx.query ), body: undefined, } - const { status, body } = await implementation.actionsListArtifactsForRepo( - input, - ctx - ) + const { status, body } = + await implementation.actionsListSelfHostedRunnersForRepo(input, ctx) ctx.body = responseValidationFactory( [ @@ -46192,27 +34421,20 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - artifacts: z.array( + runners: z.array( z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), }) - .optional(), + ), }) ), }), @@ -46225,52 +34447,41 @@ export function bootstrap( } ) - const actionsGetArtifactParamSchema = z.object({ + const actionsListRunnerApplicationsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - artifact_id: z.coerce.number(), }) router.get( - "actionsGetArtifact", - "/repos/:owner/:repo/actions/artifacts/:artifactId", + "actionsListRunnerApplicationsForRepo", + "/repos/:owner/:repo/actions/runners/downloads", async (ctx, next) => { const input = { - params: parseRequestInput(actionsGetArtifactParamSchema, ctx.params), + params: parseRequestInput( + actionsListRunnerApplicationsForRepoParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetArtifact( - input, - ctx - ) + const { status, body } = + await implementation.actionsListRunnerApplicationsForRepo(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ - id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), - }) - .optional(), - }), + z.array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ), ], ], undefined @@ -46280,74 +34491,59 @@ export function bootstrap( } ) - const actionsDeleteArtifactParamSchema = z.object({ + const actionsCreateRegistrationTokenForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - artifact_id: z.coerce.number(), }) - router.delete( - "actionsDeleteArtifact", - "/repos/:owner/:repo/actions/artifacts/:artifactId", + router.post( + "actionsCreateRegistrationTokenForRepo", + "/repos/:owner/:repo/actions/runners/registration-token", async (ctx, next) => { const input = { - params: parseRequestInput(actionsDeleteArtifactParamSchema, ctx.params), + params: parseRequestInput( + actionsCreateRegistrationTokenForRepoParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsDeleteArtifact( - input, - ctx - ) + const { status, body } = + await implementation.actionsCreateRegistrationTokenForRepo(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [["201", s_authentication_token]], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsDownloadArtifactParamSchema = z.object({ + const actionsCreateRemoveTokenForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - artifact_id: z.coerce.number(), - archive_format: z.coerce.string(), }) - router.get( - "actionsDownloadArtifact", - "/repos/:owner/:repo/actions/artifacts/:artifactId/:archiveFormat", + router.post( + "actionsCreateRemoveTokenForRepo", + "/repos/:owner/:repo/actions/runners/remove-token", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDownloadArtifactParamSchema, + actionsCreateRemoveTokenForRepoParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsDownloadArtifact( - input, - ctx - ) + const { status, body } = + await implementation.actionsCreateRemoveTokenForRepo(input, ctx) ctx.body = responseValidationFactory( - [ - ["302", z.void()], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], + [["201", s_authentication_token]], undefined )(status, body) ctx.status = status @@ -46355,83 +34551,92 @@ export function bootstrap( } ) - const actionsGetActionsCacheUsageParamSchema = z.object({ + const actionsGetSelfHostedRunnerForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + runner_id: z.coerce.number(), }) router.get( - "actionsGetActionsCacheUsage", - "/repos/:owner/:repo/actions/cache/usage", + "actionsGetSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetActionsCacheUsageParamSchema, + actionsGetSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetActionsCacheUsage( - input, - ctx - ) + const { status, body } = + await implementation.actionsGetSelfHostedRunnerForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - full_name: z.coerce.string(), - active_caches_size_in_bytes: z.coerce.number(), - active_caches_count: z.coerce.number(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_runner]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsGetActionsCacheListParamSchema = z.object({ + const actionsDeleteSelfHostedRunnerFromRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + runner_id: z.coerce.number(), }) - const actionsGetActionsCacheListQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - key: z.coerce.string().optional(), - sort: z - .enum(["created_at", "last_accessed_at", "size_in_bytes"]) - .optional(), - direction: z.enum(["asc", "desc"]).optional(), + router.delete( + "actionsDeleteSelfHostedRunnerFromRepo", + "/repos/:owner/:repo/actions/runners/:runnerId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteSelfHostedRunnerFromRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsListLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + runner_id: z.coerce.number(), }) router.get( - "actionsGetActionsCacheList", - "/repos/:owner/:repo/actions/caches", + "actionsListLabelsForSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetActionsCacheListParamSchema, + actionsListLabelsForSelfHostedRunnerForRepoParamSchema, ctx.params ), - query: parseRequestInput( - actionsGetActionsCacheListQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetActionsCacheList( - input, - ctx - ) + const { status, body } = + await implementation.actionsListLabelsForSelfHostedRunnerForRepo( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -46439,25 +34644,16 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - actions_caches: z.array( + labels: z.array( z.object({ id: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - key: z.coerce.string().optional(), - version: z.coerce.string().optional(), - last_accessed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - size_in_bytes: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), }) ), }), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -46466,34 +34662,37 @@ export function bootstrap( } ) - const actionsDeleteActionsCacheByKeyParamSchema = z.object({ + const actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + runner_id: z.coerce.number(), }) - const actionsDeleteActionsCacheByKeyQuerySchema = z.object({ - key: z.coerce.string(), - ref: z.coerce.string().optional(), + const actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema = z.object({ + labels: z.array(z.coerce.string()), }) - router.delete( - "actionsDeleteActionsCacheByKey", - "/repos/:owner/:repo/actions/caches", + router.post( + "actionsAddCustomLabelsToSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteActionsCacheByKeyParamSchema, + actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema, ctx.params ), - query: parseRequestInput( - actionsDeleteActionsCacheByKeyQuerySchema, - ctx.query + query: undefined, + body: parseRequestInput( + actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.actionsDeleteActionsCacheByKey(input, ctx) + await implementation.actionsAddCustomLabelsToSelfHostedRunnerForRepo( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -46501,25 +34700,17 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - actions_caches: z.array( + labels: z.array( z.object({ id: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - key: z.coerce.string().optional(), - version: z.coerce.string().optional(), - last_accessed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - size_in_bytes: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), }) ), }), ], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -46528,115 +34719,105 @@ export function bootstrap( } ) - const actionsDeleteActionsCacheByIdParamSchema = z.object({ + const actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - cache_id: z.coerce.number(), + runner_id: z.coerce.number(), }) - router.delete( - "actionsDeleteActionsCacheById", - "/repos/:owner/:repo/actions/caches/:cacheId", + const actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema = z.object({ + labels: z.array(z.coerce.string()), + }) + + router.put( + "actionsSetCustomLabelsForSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteActionsCacheByIdParamSchema, + actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema, + ctx.body + ), } const { status, body } = - await implementation.actionsDeleteActionsCacheById(input, ctx) + await implementation.actionsSetCustomLabelsForSelfHostedRunnerForRepo( + input, + ctx + ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetJobForWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - job_id: z.coerce.number(), - }) + const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema = + z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + runner_id: z.coerce.number(), + }) - router.get( - "actionsGetJobForWorkflowRun", - "/repos/:owner/:repo/actions/jobs/:jobId", + router.delete( + "actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetJobForWorkflowRunParamSchema, + actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetJobForWorkflowRun( - input, - ctx - ) + const { status, body } = + await implementation.actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", z.object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), }), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -46645,19 +34826,21 @@ export function bootstrap( } ) - const actionsDownloadJobLogsForWorkflowRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - job_id: z.coerce.number(), - }) + const actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema = + z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + runner_id: z.coerce.number(), + name: z.coerce.string(), + }) - router.get( - "actionsDownloadJobLogsForWorkflowRun", - "/repos/:owner/:repo/actions/jobs/:jobId/logs", + router.delete( + "actionsRemoveCustomLabelFromSelfHostedRunnerForRepo", + "/repos/:owner/:repo/actions/runners/:runnerId/labels/:name", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDownloadJobLogsForWorkflowRunParamSchema, + actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema, ctx.params ), query: undefined, @@ -46665,525 +34848,42 @@ export function bootstrap( } const { status, body } = - await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) + await implementation.actionsRemoveCustomLabelFromSelfHostedRunnerForRepo( + input, + ctx + ) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsReRunJobForWorkflowRunParamSchema = z.object({ + const actionsListWorkflowRunsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - job_id: z.coerce.number(), }) - const actionsReRunJobForWorkflowRunBodySchema = z - .object({ enable_debug_logging: z.coerce.boolean().optional() }) - .optional() - - router.post( - "actionsReRunJobForWorkflowRun", - "/repos/:owner/:repo/actions/jobs/:jobId/rerun", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsReRunJobForWorkflowRunParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsReRunJobForWorkflowRunBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsReRunJobForWorkflowRun(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsGetCustomOidcSubClaimForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetCustomOidcSubClaimForRepo", - "/repos/:owner/:repo/actions/oidc/customization/sub", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetCustomOidcSubClaimForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetCustomOidcSubClaimForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - use_default: z.coerce.boolean(), - include_claim_keys: z.array(z.coerce.string()).optional(), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsSetCustomOidcSubClaimForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetCustomOidcSubClaimForRepoBodySchema = z.object({ - use_default: z.coerce.boolean(), - include_claim_keys: z.array(z.coerce.string()).optional(), - }) - - router.put( - "actionsSetCustomOidcSubClaimForRepo", - "/repos/:owner/:repo/actions/oidc/customization/sub", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetCustomOidcSubClaimForRepoParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetCustomOidcSubClaimForRepoBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetCustomOidcSubClaimForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsGetGithubActionsPermissionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetGithubActionsPermissionsRepository", - "/repos/:owner/:repo/actions/permissions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetGithubActionsPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetGithubActionsPermissionsRepository( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - enabled: z.coerce.boolean(), - allowed_actions: z - .enum(["all", "local_only", "selected"]) - .optional(), - selected_actions_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsSetGithubActionsPermissionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetGithubActionsPermissionsRepositoryBodySchema = z.object({ - enabled: z.coerce.boolean(), - allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), - }) - - router.put( - "actionsSetGithubActionsPermissionsRepository", - "/repos/:owner/:repo/actions/permissions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetGithubActionsPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetGithubActionsPermissionsRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetGithubActionsPermissionsRepository( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsGetWorkflowAccessToRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetWorkflowAccessToRepository", - "/repos/:owner/:repo/actions/permissions/access", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetWorkflowAccessToRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetWorkflowAccessToRepository(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - access_level: z.enum([ - "none", - "user", - "organization", - "enterprise", - ]), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsSetWorkflowAccessToRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetWorkflowAccessToRepositoryBodySchema = z.object({ - access_level: z.enum(["none", "user", "organization", "enterprise"]), - }) - - router.put( - "actionsSetWorkflowAccessToRepository", - "/repos/:owner/:repo/actions/permissions/access", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetWorkflowAccessToRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetWorkflowAccessToRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetWorkflowAccessToRepository(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsGetAllowedActionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "actionsGetAllowedActionsRepository", - "/repos/:owner/:repo/actions/permissions/selected-actions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetAllowedActionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetAllowedActionsRepository(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsSetAllowedActionsRepositoryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsSetAllowedActionsRepositoryBodySchema = z - .object({ - github_owned_allowed: z.coerce.boolean().optional(), - verified_allowed: z.coerce.boolean().optional(), - patterns_allowed: z.array(z.coerce.string()).optional(), - }) - .optional() - - router.put( - "actionsSetAllowedActionsRepository", - "/repos/:owner/:repo/actions/permissions/selected-actions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetAllowedActionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetAllowedActionsRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetAllowedActionsRepository(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = - z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) - - router.get( - "actionsGetGithubActionsDefaultWorkflowPermissionsRepository", - "/repos/:owner/:repo/actions/permissions/workflow", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetGithubActionsDefaultWorkflowPermissionsRepository( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - default_workflow_permissions: z.enum(["read", "write"]), - can_approve_pull_request_reviews: z.coerce.boolean(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = - z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) - - const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema = - z.object({ - default_workflow_permissions: z.enum(["read", "write"]).optional(), - can_approve_pull_request_reviews: z.coerce.boolean().optional(), - }) - - router.put( - "actionsSetGithubActionsDefaultWorkflowPermissionsRepository", - "/repos/:owner/:repo/actions/permissions/workflow", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsSetGithubActionsDefaultWorkflowPermissionsRepository( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsListRequiredWorkflowRunsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - required_workflow_id_for_repo: z.coerce.number(), - }) - - const actionsListRequiredWorkflowRunsQuerySchema = z.object({ + const actionsListWorkflowRunsForRepoQuerySchema = z.object({ actor: z.coerce.string().optional(), branch: z.coerce.string().optional(), event: z.coerce.string().optional(), @@ -47213,23 +34913,23 @@ export function bootstrap( }) router.get( - "actionsListRequiredWorkflowRuns", - "/repos/:owner/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/runs", + "actionsListWorkflowRunsForRepo", + "/repos/:owner/:repo/actions/runs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListRequiredWorkflowRunsParamSchema, + actionsListWorkflowRunsForRepoParamSchema, ctx.params ), query: parseRequestInput( - actionsListRequiredWorkflowRunsQuerySchema, + actionsListWorkflowRunsForRepoQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.actionsListRequiredWorkflowRuns(input, ctx) + await implementation.actionsListWorkflowRunsForRepo(input, ctx) ctx.body = responseValidationFactory( [ @@ -47705,60 +35405,33 @@ export function bootstrap( } ) - const actionsListSelfHostedRunnersForRepoParamSchema = z.object({ + const actionsGetWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) - const actionsListSelfHostedRunnersForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const actionsGetWorkflowRunQuerySchema = z.object({ + exclude_pull_requests: z.coerce.boolean().optional(), }) router.get( - "actionsListSelfHostedRunnersForRepo", - "/repos/:owner/:repo/actions/runners", + "actionsGetWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsListSelfHostedRunnersForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListSelfHostedRunnersForRepoQuerySchema, - ctx.query - ), + params: parseRequestInput(actionsGetWorkflowRunParamSchema, ctx.params), + query: parseRequestInput(actionsGetWorkflowRunQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.actionsListSelfHostedRunnersForRepo(input, ctx) + const { status, body } = await implementation.actionsGetWorkflowRun( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }), - ], - ], + [["200", s_workflow_run]], undefined )(status, body) ctx.status = status @@ -47766,26 +35439,62 @@ export function bootstrap( } ) - const actionsListRunnerApplicationsForRepoParamSchema = z.object({ + const actionsDeleteWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), + }) + + router.delete( + "actionsDeleteWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteWorkflowRunParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsDeleteWorkflowRun( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsGetReviewsForRunParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), }) router.get( - "actionsListRunnerApplicationsForRepo", - "/repos/:owner/:repo/actions/runners/downloads", + "actionsGetReviewsForRun", + "/repos/:owner/:repo/actions/runs/:runId/approvals", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListRunnerApplicationsForRepoParamSchema, + actionsGetReviewsForRunParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsListRunnerApplicationsForRepo(input, ctx) + const { status, body } = await implementation.actionsGetReviewsForRun( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -47793,12 +35502,48 @@ export function bootstrap( "200", z.array( z.object({ - os: z.coerce.string(), - architecture: z.coerce.string(), - download_url: z.coerce.string(), - filename: z.coerce.string(), - temp_download_token: z.coerce.string().optional(), - sha256_checksum: z.coerce.string().optional(), + environments: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + state: z.enum(["approved", "rejected"]), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comment: z.coerce.string(), }) ), ], @@ -47810,342 +35555,102 @@ export function bootstrap( } ) - const actionsCreateRegistrationTokenForRepoParamSchema = z.object({ + const actionsApproveWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) router.post( - "actionsCreateRegistrationTokenForRepo", - "/repos/:owner/:repo/actions/runners/registration-token", + "actionsApproveWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/approve", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateRegistrationTokenForRepoParamSchema, + actionsApproveWorkflowRunParamSchema, ctx.params ), query: undefined, body: undefined, } + const { status, body } = await implementation.actionsApproveWorkflowRun( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsListWorkflowRunArtifactsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + }) + + const actionsListWorkflowRunArtifactsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListWorkflowRunArtifacts", + "/repos/:owner/:repo/actions/runs/:runId/artifacts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListWorkflowRunArtifactsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListWorkflowRunArtifactsQuerySchema, + ctx.query + ), + body: undefined, + } + const { status, body } = - await implementation.actionsCreateRegistrationTokenForRepo(input, ctx) + await implementation.actionsListWorkflowRunArtifacts(input, ctx) ctx.body = responseValidationFactory( [ [ - "201", + "200", z.object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), }), ], ], @@ -48156,345 +35661,38 @@ export function bootstrap( } ) - const actionsCreateRemoveTokenForRepoParamSchema = z.object({ + const actionsGetWorkflowRunAttemptParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), + attempt_number: z.coerce.number(), }) - router.post( - "actionsCreateRemoveTokenForRepo", - "/repos/:owner/:repo/actions/runners/remove-token", + const actionsGetWorkflowRunAttemptQuerySchema = z.object({ + exclude_pull_requests: z.coerce.boolean().optional(), + }) + + router.get( + "actionsGetWorkflowRunAttempt", + "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateRemoveTokenForRepoParamSchema, + actionsGetWorkflowRunAttemptParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + actionsGetWorkflowRunAttemptQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.actionsCreateRemoveTokenForRepo(input, ctx) + await implementation.actionsGetWorkflowRunAttempt(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - token: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({}).optional(), - repositories: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ) - .optional(), - single_file: z.coerce.string().optional(), - repository_selection: z.enum(["all", "selected"]).optional(), - }), - ], - ], + [["200", s_workflow_run]], undefined )(status, body) ctx.status = status @@ -48502,47 +35700,97 @@ export function bootstrap( } ) - const actionsGetSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsListJobsForWorkflowRunAttemptParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), + run_id: z.coerce.number(), + attempt_number: z.coerce.number(), + }) + + const actionsListJobsForWorkflowRunAttemptQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "actionsGetSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId", + "actionsListJobsForWorkflowRunAttempt", + "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/jobs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetSelfHostedRunnerForRepoParamSchema, + actionsListJobsForWorkflowRunAttemptParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + actionsListJobsForWorkflowRunAttemptQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.actionsGetSelfHostedRunnerForRepo(input, ctx) + await implementation.actionsListJobsForWorkflowRunAttempt(input, ctx) ctx.body = responseValidationFactory( [ [ "200", z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( + total_count: z.coerce.number(), + jobs: z.array( z.object({ - id: z.coerce.number().optional(), + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), }) ), }), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -48551,19 +35799,20 @@ export function bootstrap( } ) - const actionsDeleteSelfHostedRunnerFromRepoParamSchema = z.object({ + const actionsDownloadWorkflowRunAttemptLogsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), + run_id: z.coerce.number(), + attempt_number: z.coerce.number(), }) - router.delete( - "actionsDeleteSelfHostedRunnerFromRepo", - "/repos/:owner/:repo/actions/runners/:runnerId", + router.get( + "actionsDownloadWorkflowRunAttemptLogs", + "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/logs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteSelfHostedRunnerFromRepoParamSchema, + actionsDownloadWorkflowRunAttemptLogsParamSchema, ctx.params ), query: undefined, @@ -48571,9 +35820,9 @@ export function bootstrap( } const { status, body } = - await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) + await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( status, body ) @@ -48582,55 +35831,34 @@ export function bootstrap( } ) - const actionsListLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsCancelWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), + run_id: z.coerce.number(), }) - router.get( - "actionsListLabelsForSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + router.post( + "actionsCancelWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/cancel", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListLabelsForSelfHostedRunnerForRepoParamSchema, + actionsCancelWorkflowRunParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsListLabelsForSelfHostedRunnerForRepo( - input, - ctx - ) + const { status, body } = await implementation.actionsCancelWorkflowRun( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["202", s_empty_object], + ["409", s_basic_error], ], undefined )(status, body) @@ -48639,37 +35867,36 @@ export function bootstrap( } ) - const actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsListJobsForWorkflowRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), + run_id: z.coerce.number(), }) - const actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema = z.object({ - labels: z.array(z.coerce.string()), + const actionsListJobsForWorkflowRunQuerySchema = z.object({ + filter: z.enum(["latest", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "actionsAddCustomLabelsToSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + router.get( + "actionsListJobsForWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/jobs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsAddCustomLabelsToSelfHostedRunnerForRepoParamSchema, + actionsListJobsForWorkflowRunParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - actionsAddCustomLabelsToSelfHostedRunnerForRepoBodySchema, - ctx.body + query: parseRequestInput( + actionsListJobsForWorkflowRunQuerySchema, + ctx.query ), + body: undefined, } const { status, body } = - await implementation.actionsAddCustomLabelsToSelfHostedRunnerForRepo( - input, - ctx - ) + await implementation.actionsListJobsForWorkflowRun(input, ctx) ctx.body = responseValidationFactory( [ @@ -48677,126 +35904,111 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - labels: z.array( + jobs: z.array( z.object({ - id: z.coerce.number().optional(), + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema = z.object({ + const actionsDownloadWorkflowRunLogsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - runner_id: z.coerce.number(), - }) - - const actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema = z.object({ - labels: z.array(z.coerce.string()), + run_id: z.coerce.number(), }) - router.put( - "actionsSetCustomLabelsForSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + router.get( + "actionsDownloadWorkflowRunLogs", + "/repos/:owner/:repo/actions/runs/:runId/logs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsSetCustomLabelsForSelfHostedRunnerForRepoParamSchema, + actionsDownloadWorkflowRunLogsParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsSetCustomLabelsForSelfHostedRunnerForRepoBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.actionsSetCustomLabelsForSelfHostedRunnerForRepo( - input, - ctx - ) + await implementation.actionsDownloadWorkflowRunLogs(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema = - z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - runner_id: z.coerce.number(), - }) + const actionsDeleteWorkflowRunLogsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + }) router.delete( - "actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels", + "actionsDeleteWorkflowRunLogs", + "/repos/:owner/:repo/actions/runs/:runId/logs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamSchema, + actionsDeleteWorkflowRunLogsParamSchema, ctx.params ), query: undefined, @@ -48804,35 +36016,13 @@ export function bootstrap( } const { status, body } = - await implementation.actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo( - input, - ctx - ) + await implementation.actionsDeleteWorkflowRunLogs(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["204", z.void()], + ["403", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -48841,21 +36031,19 @@ export function bootstrap( } ) - const actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema = - z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - runner_id: z.coerce.number(), - name: z.coerce.string(), - }) + const actionsGetPendingDeploymentsForRunParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + }) - router.delete( - "actionsRemoveCustomLabelFromSelfHostedRunnerForRepo", - "/repos/:owner/:repo/actions/runners/:runnerId/labels/:name", + router.get( + "actionsGetPendingDeploymentsForRun", + "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", async (ctx, next) => { const input = { params: parseRequestInput( - actionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamSchema, + actionsGetPendingDeploymentsForRunParamSchema, ctx.params ), query: undefined, @@ -48863,42 +36051,34 @@ export function bootstrap( } const { status, body } = - await implementation.actionsRemoveCustomLabelFromSelfHostedRunnerForRepo( - input, - ctx - ) + await implementation.actionsGetPendingDeploymentsForRun(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ + z.array( + z.object({ + environment: z.object({ id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }), + wait_timer: z.coerce.number(), + wait_timer_started_at: z.coerce + .string() + .datetime({ offset: true }), + current_user_can_approve: z.coerce.boolean(), + reviewers: z.array( + z.object({ + type: z.enum(["User", "Team"]).optional(), + reviewer: z.object({}).optional(), + }) + ), + }) + ), ], ], undefined @@ -48908,200 +36088,87 @@ export function bootstrap( } ) - const actionsListWorkflowRunsForRepoParamSchema = z.object({ + const actionsReviewPendingDeploymentsForRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + run_id: z.coerce.number(), }) - const actionsListWorkflowRunsForRepoQuerySchema = z.object({ - actor: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - event: z.coerce.string().optional(), - status: z - .enum([ - "completed", - "action_required", - "cancelled", - "failure", - "neutral", - "skipped", - "stale", - "success", - "timed_out", - "in_progress", - "queued", - "requested", - "waiting", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - created: z.coerce.string().datetime({ offset: true }).optional(), - exclude_pull_requests: z.coerce.boolean().optional(), - check_suite_id: z.coerce.number().optional(), - head_sha: z.coerce.string().optional(), + const actionsReviewPendingDeploymentsForRunBodySchema = z.object({ + environment_ids: z.array(z.coerce.number()), + state: z.enum(["approved", "rejected"]), + comment: z.coerce.string(), }) - router.get( - "actionsListWorkflowRunsForRepo", - "/repos/:owner/:repo/actions/runs", + router.post( + "actionsReviewPendingDeploymentsForRun", + "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListWorkflowRunsForRepoParamSchema, + actionsReviewPendingDeploymentsForRunParamSchema, ctx.params ), - query: parseRequestInput( - actionsListWorkflowRunsForRepoQuerySchema, - ctx.query + query: undefined, + body: parseRequestInput( + actionsReviewPendingDeploymentsForRunBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.actionsListWorkflowRunsForRepo(input, ctx) + await implementation.actionsReviewPendingDeploymentsForRun(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -49125,307 +36192,29 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), + name: z.coerce.string(), description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), ], ], undefined @@ -49435,27 +36224,135 @@ export function bootstrap( } ) - const actionsGetWorkflowRunParamSchema = z.object({ + const actionsReRunWorkflowParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), run_id: z.coerce.number(), }) - const actionsGetWorkflowRunQuerySchema = z.object({ - exclude_pull_requests: z.coerce.boolean().optional(), + const actionsReRunWorkflowBodySchema = z + .object({ enable_debug_logging: z.coerce.boolean().optional() }) + .optional() + + router.post( + "actionsReRunWorkflow", + "/repos/:owner/:repo/actions/runs/:runId/rerun", + async (ctx, next) => { + const input = { + params: parseRequestInput(actionsReRunWorkflowParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(actionsReRunWorkflowBodySchema, ctx.body), + } + + const { status, body } = await implementation.actionsReRunWorkflow( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["201", s_empty_object]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsReRunWorkflowFailedJobsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), + }) + + const actionsReRunWorkflowFailedJobsBodySchema = z + .object({ enable_debug_logging: z.coerce.boolean().optional() }) + .optional() + + router.post( + "actionsReRunWorkflowFailedJobs", + "/repos/:owner/:repo/actions/runs/:runId/rerun-failed-jobs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsReRunWorkflowFailedJobsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsReRunWorkflowFailedJobsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsReRunWorkflowFailedJobs(input, ctx) + + ctx.body = responseValidationFactory( + [["201", s_empty_object]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetWorkflowRunUsageParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + run_id: z.coerce.number(), }) router.get( - "actionsGetWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId", + "actionsGetWorkflowRunUsage", + "/repos/:owner/:repo/actions/runs/:runId/timing", async (ctx, next) => { const input = { - params: parseRequestInput(actionsGetWorkflowRunParamSchema, ctx.params), - query: parseRequestInput(actionsGetWorkflowRunQuerySchema, ctx.query), + params: parseRequestInput( + actionsGetWorkflowRunUsageParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetWorkflowRun( + const { status, body } = await implementation.actionsGetWorkflowRunUsage( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_workflow_run_usage]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsListRepoSecretsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const actionsListRepoSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListRepoSecrets", + "/repos/:owner/:repo/actions/secrets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListRepoSecretsParamSchema, + ctx.params + ), + query: parseRequestInput(actionsListRepoSecretsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.actionsListRepoSecrets( input, ctx ) @@ -49465,460 +36362,14 @@ export function bootstrap( [ "200", z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( + total_count: z.coerce.number(), + secrets: z.array( z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }) ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), }), ], ], @@ -49929,114 +36380,102 @@ export function bootstrap( } ) - const actionsDeleteWorkflowRunParamSchema = z.object({ + const actionsGetRepoPublicKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) - router.delete( - "actionsDeleteWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId", + router.get( + "actionsGetRepoPublicKey", + "/repos/:owner/:repo/actions/secrets/public-key", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteWorkflowRunParamSchema, + actionsGetRepoPublicKeyParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsDeleteWorkflowRun( + const { status, body } = await implementation.actionsGetRepoPublicKey( input, ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [["200", s_actions_public_key]], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsGetReviewsForRunParamSchema = z.object({ + const actionsGetRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + secret_name: z.coerce.string(), }) router.get( - "actionsGetReviewsForRun", - "/repos/:owner/:repo/actions/runs/:runId/approvals", + "actionsGetRepoSecret", + "/repos/:owner/:repo/actions/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsGetReviewsForRunParamSchema, - ctx.params - ), + params: parseRequestInput(actionsGetRepoSecretParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetReviewsForRun( + const { status, body } = await implementation.actionsGetRepoSecret( input, ctx ) + ctx.body = responseValidationFactory( + [["200", s_actions_secret]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsCreateOrUpdateRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const actionsCreateOrUpdateRepoSecretBodySchema = z.object({ + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string().optional(), + }) + + router.put( + "actionsCreateOrUpdateRepoSecret", + "/repos/:owner/:repo/actions/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsCreateOrUpdateRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsCreateOrUpdateRepoSecretBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsCreateOrUpdateRepoSecret(input, ctx) + ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - environments: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - state: z.enum(["approved", "rejected"]), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comment: z.coerce.string(), - }) - ), - ], + ["201", s_empty_object], + ["204", z.void()], ], undefined )(status, body) @@ -50045,88 +36484,69 @@ export function bootstrap( } ) - const actionsApproveWorkflowRunParamSchema = z.object({ + const actionsDeleteRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + secret_name: z.coerce.string(), }) - router.post( - "actionsApproveWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/approve", + router.delete( + "actionsDeleteRepoSecret", + "/repos/:owner/:repo/actions/secrets/:secretName", async (ctx, next) => { const input = { params: parseRequestInput( - actionsApproveWorkflowRunParamSchema, + actionsDeleteRepoSecretParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsApproveWorkflowRun( + const { status, body } = await implementation.actionsDeleteRepoSecret( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsListWorkflowRunArtifactsParamSchema = z.object({ + const actionsListRepoVariablesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) - const actionsListWorkflowRunArtifactsQuerySchema = z.object({ + const actionsListRepoVariablesQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "actionsListWorkflowRunArtifacts", - "/repos/:owner/:repo/actions/runs/:runId/artifacts", + "actionsListRepoVariables", + "/repos/:owner/:repo/actions/variables", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListWorkflowRunArtifactsParamSchema, + actionsListRepoVariablesParamSchema, ctx.params ), query: parseRequestInput( - actionsListWorkflowRunArtifactsQuerySchema, + actionsListRepoVariablesQuerySchema, ctx.query ), body: undefined, } - const { status, body } = - await implementation.actionsListWorkflowRunArtifacts(input, ctx) + const { status, body } = await implementation.actionsListRepoVariables( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -50134,27 +36554,12 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - artifacts: z.array( + variables: z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), + value: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ - id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), - }) - .optional(), }) ), }), @@ -50167,498 +36572,36 @@ export function bootstrap( } ) - const actionsGetWorkflowRunAttemptParamSchema = z.object({ + const actionsCreateRepoVariableParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), - attempt_number: z.coerce.number(), }) - const actionsGetWorkflowRunAttemptQuerySchema = z.object({ - exclude_pull_requests: z.coerce.boolean().optional(), + const actionsCreateRepoVariableBodySchema = z.object({ + name: z.coerce.string(), + value: z.coerce.string(), }) - router.get( - "actionsGetWorkflowRunAttempt", - "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber", + router.post( + "actionsCreateRepoVariable", + "/repos/:owner/:repo/actions/variables", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetWorkflowRunAttemptParamSchema, + actionsCreateRepoVariableParamSchema, ctx.params ), - query: parseRequestInput( - actionsGetWorkflowRunAttemptQuerySchema, - ctx.query - ), - body: undefined, + query: undefined, + body: parseRequestInput(actionsCreateRepoVariableBodySchema, ctx.body), } - const { status, body } = - await implementation.actionsGetWorkflowRunAttempt(input, ctx) + const { status, body } = await implementation.actionsCreateRepoVariable( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }), - ], - ], + [["201", s_empty_object]], undefined )(status, body) ctx.status = status @@ -50666,106 +36609,32 @@ export function bootstrap( } ) - const actionsListJobsForWorkflowRunAttemptParamSchema = z.object({ + const actionsGetRepoVariableParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), - attempt_number: z.coerce.number(), - }) - - const actionsListJobsForWorkflowRunAttemptQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + name: z.coerce.string(), }) router.get( - "actionsListJobsForWorkflowRunAttempt", - "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/jobs", + "actionsGetRepoVariable", + "/repos/:owner/:repo/actions/variables/:name", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListJobsForWorkflowRunAttemptParamSchema, + actionsGetRepoVariableParamSchema, ctx.params ), - query: parseRequestInput( - actionsListJobsForWorkflowRunAttemptQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsListJobsForWorkflowRunAttempt(input, ctx) + const { status, body } = await implementation.actionsGetRepoVariable( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - jobs: z.array( - z.object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], + [["200", s_actions_variable]], undefined )(status, body) ctx.status = status @@ -50773,30 +36642,36 @@ export function bootstrap( } ) - const actionsDownloadWorkflowRunAttemptLogsParamSchema = z.object({ + const actionsUpdateRepoVariableParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), - attempt_number: z.coerce.number(), + name: z.coerce.string(), }) - router.get( - "actionsDownloadWorkflowRunAttemptLogs", - "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/logs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDownloadWorkflowRunAttemptLogsParamSchema, + const actionsUpdateRepoVariableBodySchema = z.object({ + name: z.coerce.string().optional(), + value: z.coerce.string().optional(), + }) + + router.patch( + "actionsUpdateRepoVariable", + "/repos/:owner/:repo/actions/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsUpdateRepoVariableParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(actionsUpdateRepoVariableBodySchema, ctx.body), } - const { status, body } = - await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) + const { status, body } = await implementation.actionsUpdateRepoVariable( + input, + ctx + ) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, body ) @@ -50805,80 +36680,69 @@ export function bootstrap( } ) - const actionsCancelWorkflowRunParamSchema = z.object({ + const actionsDeleteRepoVariableParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + name: z.coerce.string(), }) - router.post( - "actionsCancelWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/cancel", + router.delete( + "actionsDeleteRepoVariable", + "/repos/:owner/:repo/actions/variables/:name", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCancelWorkflowRunParamSchema, + actionsDeleteRepoVariableParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsCancelWorkflowRun( + const { status, body } = await implementation.actionsDeleteRepoVariable( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsListJobsForWorkflowRunParamSchema = z.object({ + const actionsListRepoWorkflowsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), }) - const actionsListJobsForWorkflowRunQuerySchema = z.object({ - filter: z.enum(["latest", "all"]).optional(), + const actionsListRepoWorkflowsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "actionsListJobsForWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/jobs", + "actionsListRepoWorkflows", + "/repos/:owner/:repo/actions/workflows", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListJobsForWorkflowRunParamSchema, + actionsListRepoWorkflowsParamSchema, ctx.params ), query: parseRequestInput( - actionsListJobsForWorkflowRunQuerySchema, + actionsListRepoWorkflowsQuerySchema, ctx.query ), body: undefined, } - const { status, body } = - await implementation.actionsListJobsForWorkflowRun(input, ctx) + const { status, body } = await implementation.actionsListRepoWorkflows( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -50886,55 +36750,28 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - jobs: z.array( + workflows: z.array( z.object({ id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), node_id: z.coerce.string(), - head_sha: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) + badge_url: z.coerce.string(), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), }) ), }), @@ -50947,29 +36784,28 @@ export function bootstrap( } ) - const actionsDownloadWorkflowRunLogsParamSchema = z.object({ + const actionsGetWorkflowParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) router.get( - "actionsDownloadWorkflowRunLogs", - "/repos/:owner/:repo/actions/runs/:runId/logs", + "actionsGetWorkflow", + "/repos/:owner/:repo/actions/workflows/:workflowId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsDownloadWorkflowRunLogsParamSchema, - ctx.params - ), + params: parseRequestInput(actionsGetWorkflowParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsDownloadWorkflowRunLogs(input, ctx) + const { status, body } = await implementation.actionsGetWorkflow( + input, + ctx + ) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + ctx.body = responseValidationFactory([["200", s_workflow]], undefined)( status, body ) @@ -50978,276 +36814,100 @@ export function bootstrap( } ) - const actionsDeleteWorkflowRunLogsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), - }) - - router.delete( - "actionsDeleteWorkflowRunLogs", - "/repos/:owner/:repo/actions/runs/:runId/logs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteWorkflowRunLogsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsDeleteWorkflowRunLogs(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsGetPendingDeploymentsForRunParamSchema = z.object({ + const actionsDisableWorkflowParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - router.get( - "actionsGetPendingDeploymentsForRun", - "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", + router.put( + "actionsDisableWorkflow", + "/repos/:owner/:repo/actions/workflows/:workflowId/disable", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetPendingDeploymentsForRunParamSchema, + actionsDisableWorkflowParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsGetPendingDeploymentsForRun(input, ctx) + const { status, body } = await implementation.actionsDisableWorkflow( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - environment: z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }), - wait_timer: z.coerce.number(), - wait_timer_started_at: z.coerce - .string() - .datetime({ offset: true }), - current_user_can_approve: z.coerce.boolean(), - reviewers: z.array( - z.object({ - type: z.enum(["User", "Team"]).optional(), - reviewer: z.object({}).optional(), - }) - ), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsReviewPendingDeploymentsForRunParamSchema = z.object({ + const actionsCreateWorkflowDispatchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - const actionsReviewPendingDeploymentsForRunBodySchema = z.object({ - environment_ids: z.array(z.coerce.number()), - state: z.enum(["approved", "rejected"]), - comment: z.coerce.string(), + const actionsCreateWorkflowDispatchBodySchema = z.object({ + ref: z.coerce.string(), + inputs: z.object({}).optional(), }) router.post( - "actionsReviewPendingDeploymentsForRun", - "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", + "actionsCreateWorkflowDispatch", + "/repos/:owner/:repo/actions/workflows/:workflowId/dispatches", async (ctx, next) => { const input = { params: parseRequestInput( - actionsReviewPendingDeploymentsForRunParamSchema, + actionsCreateWorkflowDispatchParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - actionsReviewPendingDeploymentsForRunBodySchema, + actionsCreateWorkflowDispatchBodySchema, ctx.body ), } const { status, body } = - await implementation.actionsReviewPendingDeploymentsForRun(input, ctx) + await implementation.actionsCreateWorkflowDispatch(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const actionsReRunWorkflowParamSchema = z.object({ + const actionsEnableWorkflowParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - const actionsReRunWorkflowBodySchema = z - .object({ enable_debug_logging: z.coerce.boolean().optional() }) - .optional() - - router.post( - "actionsReRunWorkflow", - "/repos/:owner/:repo/actions/runs/:runId/rerun", + router.put( + "actionsEnableWorkflow", + "/repos/:owner/:repo/actions/workflows/:workflowId/enable", async (ctx, next) => { const input = { - params: parseRequestInput(actionsReRunWorkflowParamSchema, ctx.params), + params: parseRequestInput(actionsEnableWorkflowParamSchema, ctx.params), query: undefined, - body: parseRequestInput(actionsReRunWorkflowBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.actionsReRunWorkflow( + const { status, body } = await implementation.actionsEnableWorkflow( input, ctx ) - ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, body ) @@ -51256,152 +36916,55 @@ export function bootstrap( } ) - const actionsReRunWorkflowFailedJobsParamSchema = z.object({ + const actionsListWorkflowRunsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - run_id: z.coerce.number(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - const actionsReRunWorkflowFailedJobsBodySchema = z - .object({ enable_debug_logging: z.coerce.boolean().optional() }) - .optional() - - router.post( - "actionsReRunWorkflowFailedJobs", - "/repos/:owner/:repo/actions/runs/:runId/rerun-failed-jobs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsReRunWorkflowFailedJobsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsReRunWorkflowFailedJobsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsReRunWorkflowFailedJobs(input, ctx) - - ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsGetWorkflowRunUsageParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - run_id: z.coerce.number(), + const actionsListWorkflowRunsQuerySchema = z.object({ + actor: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + event: z.coerce.string().optional(), + status: z + .enum([ + "completed", + "action_required", + "cancelled", + "failure", + "neutral", + "skipped", + "stale", + "success", + "timed_out", + "in_progress", + "queued", + "requested", + "waiting", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + created: z.coerce.string().datetime({ offset: true }).optional(), + exclude_pull_requests: z.coerce.boolean().optional(), + check_suite_id: z.coerce.number().optional(), + head_sha: z.coerce.string().optional(), }) router.get( - "actionsGetWorkflowRunUsage", - "/repos/:owner/:repo/actions/runs/:runId/timing", + "actionsListWorkflowRuns", + "/repos/:owner/:repo/actions/workflows/:workflowId/runs", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetWorkflowRunUsageParamSchema, + actionsListWorkflowRunsParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput(actionsListWorkflowRunsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.actionsGetWorkflowRunUsage( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - billable: z.object({ - UBUNTU: z - .object({ - total_ms: z.coerce.number(), - jobs: z.coerce.number(), - job_runs: z - .array( - z.object({ - job_id: z.coerce.number(), - duration_ms: z.coerce.number(), - }) - ) - .optional(), - }) - .optional(), - MACOS: z - .object({ - total_ms: z.coerce.number(), - jobs: z.coerce.number(), - job_runs: z - .array( - z.object({ - job_id: z.coerce.number(), - duration_ms: z.coerce.number(), - }) - ) - .optional(), - }) - .optional(), - WINDOWS: z - .object({ - total_ms: z.coerce.number(), - jobs: z.coerce.number(), - job_runs: z - .array( - z.object({ - job_id: z.coerce.number(), - duration_ms: z.coerce.number(), - }) - ) - .optional(), - }) - .optional(), - }), - run_duration_ms: z.coerce.number().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsListRepoSecretsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const actionsListRepoSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "actionsListRepoSecrets", - "/repos/:owner/:repo/actions/secrets", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListRepoSecretsParamSchema, - ctx.params - ), - query: parseRequestInput(actionsListRepoSecretsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.actionsListRepoSecrets( + const { status, body } = await implementation.actionsListWorkflowRuns( input, ctx ) @@ -51412,11 +36975,462 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - secrets: z.array( + workflow_runs: z.array( z.object({ - name: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), }) ), }), @@ -51429,43 +37443,32 @@ export function bootstrap( } ) - const actionsGetRepoPublicKeyParamSchema = z.object({ + const actionsGetWorkflowUsageParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) router.get( - "actionsGetRepoPublicKey", - "/repos/:owner/:repo/actions/secrets/public-key", + "actionsGetWorkflowUsage", + "/repos/:owner/:repo/actions/workflows/:workflowId/timing", async (ctx, next) => { const input = { params: parseRequestInput( - actionsGetRepoPublicKeyParamSchema, + actionsGetWorkflowUsageParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetRepoPublicKey( + const { status, body } = await implementation.actionsGetWorkflowUsage( input, ctx ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }), - ], - ], + [["200", s_workflow_usage]], undefined )(status, body) ctx.status = status @@ -51473,23 +37476,27 @@ export function bootstrap( } ) - const actionsGetRepoSecretParamSchema = z.object({ + const issuesListAssigneesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - secret_name: z.coerce.string(), + }) + + const issuesListAssigneesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "actionsGetRepoSecret", - "/repos/:owner/:repo/actions/secrets/:secretName", + "issuesListAssignees", + "/repos/:owner/:repo/assignees", async (ctx, next) => { const input = { - params: parseRequestInput(actionsGetRepoSecretParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(issuesListAssigneesParamSchema, ctx.params), + query: parseRequestInput(issuesListAssigneesQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.actionsGetRepoSecret( + const { status, body } = await implementation.issuesListAssignees( input, ctx ) @@ -51498,12 +37505,33 @@ export function bootstrap( [ [ "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -51512,40 +37540,32 @@ export function bootstrap( } ) - const actionsCreateOrUpdateRepoSecretParamSchema = z.object({ + const issuesCheckUserCanBeAssignedParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const actionsCreateOrUpdateRepoSecretBodySchema = z.object({ - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string().optional(), + assignee: z.coerce.string(), }) - router.put( - "actionsCreateOrUpdateRepoSecret", - "/repos/:owner/:repo/actions/secrets/:secretName", + router.get( + "issuesCheckUserCanBeAssigned", + "/repos/:owner/:repo/assignees/:assignee", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateOrUpdateRepoSecretParamSchema, + issuesCheckUserCanBeAssignedParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsCreateOrUpdateRepoSecretBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.actionsCreateOrUpdateRepoSecret(input, ctx) + await implementation.issuesCheckUserCanBeAssigned(input, ctx) ctx.body = responseValidationFactory( [ - ["201", z.object({})], ["204", z.void()], + ["404", s_basic_error], ], undefined )(status, body) @@ -51554,66 +37574,26 @@ export function bootstrap( } ) - const actionsDeleteRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.delete( - "actionsDeleteRepoSecret", - "/repos/:owner/:repo/actions/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsDeleteRepoSecret( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsListRepoVariablesParamSchema = z.object({ + const reposListAutolinksParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const actionsListRepoVariablesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), + const reposListAutolinksQuerySchema = z.object({ page: z.coerce.number().optional(), }) router.get( - "actionsListRepoVariables", - "/repos/:owner/:repo/actions/variables", + "reposListAutolinks", + "/repos/:owner/:repo/autolinks", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsListRepoVariablesParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListRepoVariablesQuerySchema, - ctx.query - ), + params: parseRequestInput(reposListAutolinksParamSchema, ctx.params), + query: parseRequestInput(reposListAutolinksQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.actionsListRepoVariables( + const { status, body } = await implementation.reposListAutolinks( input, ctx ) @@ -51622,17 +37602,14 @@ export function bootstrap( [ [ "200", - z.object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), + z.array( + z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }) + ), ], ], undefined @@ -51642,78 +37619,36 @@ export function bootstrap( } ) - const actionsCreateRepoVariableParamSchema = z.object({ + const reposCreateAutolinkParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const actionsCreateRepoVariableBodySchema = z.object({ - name: z.coerce.string(), - value: z.coerce.string(), + const reposCreateAutolinkBodySchema = z.object({ + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean().optional(), }) router.post( - "actionsCreateRepoVariable", - "/repos/:owner/:repo/actions/variables", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsCreateRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(actionsCreateRepoVariableBodySchema, ctx.body), - } - - const { status, body } = await implementation.actionsCreateRepoVariable( - input, - ctx - ) - - ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsGetRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.get( - "actionsGetRepoVariable", - "/repos/:owner/:repo/actions/variables/:name", + "reposCreateAutolink", + "/repos/:owner/:repo/autolinks", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsGetRepoVariableParamSchema, - ctx.params - ), + params: parseRequestInput(reposCreateAutolinkParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(reposCreateAutolinkBodySchema, ctx.body), } - const { status, body } = await implementation.actionsGetRepoVariable( + const { status, body } = await implementation.reposCreateAutolink( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["201", s_autolink], + ["422", s_validation_error], ], undefined )(status, body) @@ -51722,140 +37657,28 @@ export function bootstrap( } ) - const actionsUpdateRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - const actionsUpdateRepoVariableBodySchema = z.object({ - name: z.coerce.string().optional(), - value: z.coerce.string().optional(), - }) - - router.patch( - "actionsUpdateRepoVariable", - "/repos/:owner/:repo/actions/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsUpdateRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(actionsUpdateRepoVariableBodySchema, ctx.body), - } - - const { status, body } = await implementation.actionsUpdateRepoVariable( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsDeleteRepoVariableParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.delete( - "actionsDeleteRepoVariable", - "/repos/:owner/:repo/actions/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteRepoVariableParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.actionsDeleteRepoVariable( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsListRepoWorkflowsParamSchema = z.object({ + const reposGetAutolinkParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const actionsListRepoWorkflowsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + autolink_id: z.coerce.number(), }) router.get( - "actionsListRepoWorkflows", - "/repos/:owner/:repo/actions/workflows", + "reposGetAutolink", + "/repos/:owner/:repo/autolinks/:autolinkId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsListRepoWorkflowsParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListRepoWorkflowsQuerySchema, - ctx.query - ), + params: parseRequestInput(reposGetAutolinkParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.actionsListRepoWorkflows( - input, - ctx - ) + const { status, body } = await implementation.reposGetAutolink(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - workflows: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum([ - "active", - "deleted", - "disabled_fork", - "disabled_inactivity", - "disabled_manually", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - }), - ], + ["200", s_autolink], + ["404", s_basic_error], ], undefined )(status, body) @@ -51864,54 +37687,31 @@ export function bootstrap( } ) - const actionsGetWorkflowParamSchema = z.object({ + const reposDeleteAutolinkParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + autolink_id: z.coerce.number(), }) - router.get( - "actionsGetWorkflow", - "/repos/:owner/:repo/actions/workflows/:workflowId", + router.delete( + "reposDeleteAutolink", + "/repos/:owner/:repo/autolinks/:autolinkId", async (ctx, next) => { const input = { - params: parseRequestInput(actionsGetWorkflowParamSchema, ctx.params), + params: parseRequestInput(reposDeleteAutolinkParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetWorkflow( + const { status, body } = await implementation.reposDeleteAutolink( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum([ - "active", - "deleted", - "disabled_fork", - "disabled_inactivity", - "disabled_manually", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }), - ], + ["204", z.void()], + ["404", s_basic_error], ], undefined )(status, body) @@ -51920,29 +37720,26 @@ export function bootstrap( } ) - const actionsDisableWorkflowParamSchema = z.object({ + const reposEnableAutomatedSecurityFixesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) router.put( - "actionsDisableWorkflow", - "/repos/:owner/:repo/actions/workflows/:workflowId/disable", + "reposEnableAutomatedSecurityFixes", + "/repos/:owner/:repo/automated-security-fixes", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDisableWorkflowParamSchema, + reposEnableAutomatedSecurityFixesParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsDisableWorkflow( - input, - ctx - ) + const { status, body } = + await implementation.reposEnableAutomatedSecurityFixes(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -51953,65 +37750,26 @@ export function bootstrap( } ) - const actionsCreateWorkflowDispatchParamSchema = z.object({ + const reposDisableAutomatedSecurityFixesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - const actionsCreateWorkflowDispatchBodySchema = z.object({ - ref: z.coerce.string(), - inputs: z.object({}).optional(), - }) - - router.post( - "actionsCreateWorkflowDispatch", - "/repos/:owner/:repo/actions/workflows/:workflowId/dispatches", + router.delete( + "reposDisableAutomatedSecurityFixes", + "/repos/:owner/:repo/automated-security-fixes", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateWorkflowDispatchParamSchema, + reposDisableAutomatedSecurityFixesParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsCreateWorkflowDispatchBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsCreateWorkflowDispatch(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsEnableWorkflowParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), - }) - - router.put( - "actionsEnableWorkflow", - "/repos/:owner/:repo/actions/workflows/:workflowId/enable", - async (ctx, next) => { - const input = { - params: parseRequestInput(actionsEnableWorkflowParamSchema, ctx.params), - query: undefined, body: undefined, } - const { status, body } = await implementation.actionsEnableWorkflow( - input, - ctx - ) + const { status, body } = + await implementation.reposDisableAutomatedSecurityFixes(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -52022,55 +37780,28 @@ export function bootstrap( } ) - const actionsListWorkflowRunsParamSchema = z.object({ + const reposListBranchesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) - const actionsListWorkflowRunsQuerySchema = z.object({ - actor: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - event: z.coerce.string().optional(), - status: z - .enum([ - "completed", - "action_required", - "cancelled", - "failure", - "neutral", - "skipped", - "stale", - "success", - "timed_out", - "in_progress", - "queued", - "requested", - "waiting", - ]) - .optional(), + const reposListBranchesQuerySchema = z.object({ + protected: z.coerce.boolean().optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - created: z.coerce.string().datetime({ offset: true }).optional(), - exclude_pull_requests: z.coerce.boolean().optional(), - check_suite_id: z.coerce.number().optional(), - head_sha: z.coerce.string().optional(), }) router.get( - "actionsListWorkflowRuns", - "/repos/:owner/:repo/actions/workflows/:workflowId/runs", + "reposListBranches", + "/repos/:owner/:repo/branches", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsListWorkflowRunsParamSchema, - ctx.params - ), - query: parseRequestInput(actionsListWorkflowRunsQuerySchema, ctx.query), + params: parseRequestInput(reposListBranchesParamSchema, ctx.params), + query: parseRequestInput(reposListBranchesQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.actionsListWorkflowRuns( + const { status, body } = await implementation.reposListBranches( input, ctx ) @@ -52079,468 +37810,446 @@ export function bootstrap( [ [ "200", - z.object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), + z.array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z + }), + protected: z.coerce.boolean(), + protection: z + .object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), + }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), }) .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + enforce_admins: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + enabled: z.coerce.boolean(), }) .optional(), - license: z + required_pull_request_reviews: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z + dismissal_restrictions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce + .number() + .optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), }) .optional(), - secret_scanning_push_protection: z + bypass_pull_request_allowances: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce + .number() + .optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce + .number() + .optional(), + require_last_push_approval: z.coerce + .boolean() + .optional(), }) .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + restrictions: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce + .string() + .optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), }) .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + url: z.coerce.string(), + enabled: z.coerce.boolean(), }) .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }) + .optional(), + protection_url: z.coerce.string().optional(), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -52549,48 +38258,29 @@ export function bootstrap( } ) - const actionsGetWorkflowUsageParamSchema = z.object({ + const reposGetBranchParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - workflow_id: z.union([z.coerce.number(), z.coerce.string()]), + branch: z.coerce.string(), }) router.get( - "actionsGetWorkflowUsage", - "/repos/:owner/:repo/actions/workflows/:workflowId/timing", + "reposGetBranch", + "/repos/:owner/:repo/branches/:branch", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsGetWorkflowUsageParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetBranchParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetWorkflowUsage( - input, - ctx - ) + const { status, body } = await implementation.reposGetBranch(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - billable: z.object({ - UBUNTU: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - MACOS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - WINDOWS: z - .object({ total_ms: z.coerce.number().optional() }) - .optional(), - }), - }), - ], + ["200", s_branch_with_protection], + ["301", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -52599,70 +38289,34 @@ export function bootstrap( } ) - const issuesListAssigneesParamSchema = z.object({ + const reposGetBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const issuesListAssigneesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + branch: z.coerce.string(), }) router.get( - "issuesListAssignees", - "/repos/:owner/:repo/assignees", + "reposGetBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection", async (ctx, next) => { const input = { - params: parseRequestInput(issuesListAssigneesParamSchema, ctx.params), - query: parseRequestInput(issuesListAssigneesQuerySchema, ctx.query), + params: parseRequestInput( + reposGetBranchProtectionParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.issuesListAssignees( + const { status, body } = await implementation.reposGetBranchProtection( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_branch_protection], + ["404", s_basic_error], ], undefined )(status, body) @@ -52671,40 +38325,87 @@ export function bootstrap( } ) - const issuesCheckUserCanBeAssignedParamSchema = z.object({ + const reposUpdateBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - assignee: z.coerce.string(), + branch: z.coerce.string(), }) - router.get( - "issuesCheckUserCanBeAssigned", - "/repos/:owner/:repo/assignees/:assignee", + const reposUpdateBranchProtectionBodySchema = z.object({ + required_status_checks: z.object({ + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z + .array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number().optional(), + }) + ) + .optional(), + }), + enforce_admins: z.coerce.boolean(), + required_pull_request_reviews: z.object({ + dismissal_restrictions: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + }), + restrictions: z.object({ + users: z.array(z.coerce.string()), + teams: z.array(z.coerce.string()), + apps: z.array(z.coerce.string()).optional(), + }), + required_linear_history: z.coerce.boolean().optional(), + allow_force_pushes: z.coerce.boolean().optional(), + allow_deletions: z.coerce.boolean().optional(), + block_creations: z.coerce.boolean().optional(), + required_conversation_resolution: z.coerce.boolean().optional(), + lock_branch: z.coerce.boolean().optional(), + allow_fork_syncing: z.coerce.boolean().optional(), + }) + + router.put( + "reposUpdateBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection", async (ctx, next) => { const input = { params: parseRequestInput( - issuesCheckUserCanBeAssignedParamSchema, + reposUpdateBranchProtectionParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + reposUpdateBranchProtectionBodySchema, + ctx.body + ), } - const { status, body } = - await implementation.issuesCheckUserCanBeAssigned(input, ctx) + const { status, body } = await implementation.reposUpdateBranchProtection( + input, + ctx + ) ctx.body = responseValidationFactory( [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_protected_branch], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -52713,43 +38414,34 @@ export function bootstrap( } ) - const reposListAutolinksParamSchema = z.object({ + const reposDeleteBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) - const reposListAutolinksQuerySchema = z.object({ - page: z.coerce.number().optional(), - }) - - router.get( - "reposListAutolinks", - "/repos/:owner/:repo/autolinks", + router.delete( + "reposDeleteBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection", async (ctx, next) => { const input = { - params: parseRequestInput(reposListAutolinksParamSchema, ctx.params), - query: parseRequestInput(reposListAutolinksQuerySchema, ctx.query), + params: parseRequestInput( + reposDeleteBranchProtectionParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListAutolinks( + const { status, body } = await implementation.reposDeleteBranchProtection( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }) - ), - ], + ["204", z.void()], + ["403", s_basic_error], ], undefined )(status, body) @@ -52758,66 +38450,94 @@ export function bootstrap( } ) - const reposCreateAutolinkParamSchema = z.object({ + const reposGetAdminBranchProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) - const reposCreateAutolinkBodySchema = z.object({ - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateAutolink", - "/repos/:owner/:repo/autolinks", + router.get( + "reposGetAdminBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreateAutolinkParamSchema, ctx.params), + params: parseRequestInput( + reposGetAdminBranchProtectionParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(reposCreateAutolinkBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reposCreateAutolink( - input, - ctx - ) + const { status, body } = + await implementation.reposGetAdminBranchProtection(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_protected_branch_admin_enforced]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposSetAdminBranchProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.post( + "reposSetAdminBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposSetAdminBranchProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposSetAdminBranchProtection(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_protected_branch_admin_enforced]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteAdminBranchProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.delete( + "reposDeleteAdminBranchProtection", + "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDeleteAdminBranchProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposDeleteAdminBranchProtection(input, ctx) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["204", z.void()], + ["404", s_basic_error], ], undefined )(status, body) @@ -52826,44 +38546,89 @@ export function bootstrap( } ) - const reposGetAutolinkParamSchema = z.object({ + const reposGetPullRequestReviewProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - autolink_id: z.coerce.number(), + branch: z.coerce.string(), }) router.get( - "reposGetAutolink", - "/repos/:owner/:repo/autolinks/:autolinkId", + "reposGetPullRequestReviewProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetAutolinkParamSchema, ctx.params), + params: parseRequestInput( + reposGetPullRequestReviewProtectionParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetAutolink(input, ctx) + const { status, body } = + await implementation.reposGetPullRequestReviewProtection(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_protected_branch_pull_request_review]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdatePullRequestReviewProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposUpdatePullRequestReviewProtectionBodySchema = z + .object({ + dismissal_restrictions: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array(z.coerce.string()).optional(), + teams: z.array(z.coerce.string()).optional(), + apps: z.array(z.coerce.string()).optional(), + }) + .optional(), + }) + .optional() + + router.patch( + "reposUpdatePullRequestReviewProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdatePullRequestReviewProtectionParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposUpdatePullRequestReviewProtectionBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposUpdatePullRequestReviewProtection(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_protected_branch_pull_request_review], + ["422", s_validation_error], ], undefined )(status, body) @@ -52872,39 +38637,32 @@ export function bootstrap( } ) - const reposDeleteAutolinkParamSchema = z.object({ + const reposDeletePullRequestReviewProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - autolink_id: z.coerce.number(), + branch: z.coerce.string(), }) router.delete( - "reposDeleteAutolink", - "/repos/:owner/:repo/autolinks/:autolinkId", + "reposDeletePullRequestReviewProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeleteAutolinkParamSchema, ctx.params), + params: parseRequestInput( + reposDeletePullRequestReviewProtectionParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposDeleteAutolink( - input, - ctx - ) + const { status, body } = + await implementation.reposDeletePullRequestReviewProtection(input, ctx) ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -52913,18 +38671,19 @@ export function bootstrap( } ) - const reposEnableAutomatedSecurityFixesParamSchema = z.object({ + const reposGetCommitSignatureProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) - router.put( - "reposEnableAutomatedSecurityFixes", - "/repos/:owner/:repo/automated-security-fixes", + router.get( + "reposGetCommitSignatureProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_signatures", async (ctx, next) => { const input = { params: parseRequestInput( - reposEnableAutomatedSecurityFixesParamSchema, + reposGetCommitSignatureProtectionParamSchema, ctx.params ), query: undefined, @@ -52932,29 +38691,67 @@ export function bootstrap( } const { status, body } = - await implementation.reposEnableAutomatedSecurityFixes(input, ctx) + await implementation.reposGetCommitSignatureProtection(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["200", s_protected_branch_admin_enforced], + ["404", s_basic_error], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDisableAutomatedSecurityFixesParamSchema = z.object({ + const reposCreateCommitSignatureProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.post( + "reposCreateCommitSignatureProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_signatures", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateCommitSignatureProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposCreateCommitSignatureProtection(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_protected_branch_admin_enforced], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteCommitSignatureProtectionParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + branch: z.coerce.string(), }) router.delete( - "reposDisableAutomatedSecurityFixes", - "/repos/:owner/:repo/automated-security-fixes", + "reposDeleteCommitSignatureProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_signatures", async (ctx, next) => { const input = { params: parseRequestInput( - reposDisableAutomatedSecurityFixesParamSchema, + reposDeleteCommitSignatureProtectionParamSchema, ctx.params ), query: undefined, @@ -52962,7 +38759,128 @@ export function bootstrap( } const { status, body } = - await implementation.reposDisableAutomatedSecurityFixes(input, ctx) + await implementation.reposDeleteCommitSignatureProtection(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetStatusChecksProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetStatusChecksProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetStatusChecksProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetStatusChecksProtection(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_status_check_policy], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateStatusCheckProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposUpdateStatusCheckProtectionBodySchema = z + .object({ + strict: z.coerce.boolean().optional(), + contexts: z.array(z.coerce.string()).optional(), + checks: z + .array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number().optional(), + }) + ) + .optional(), + }) + .optional() + + router.patch( + "reposUpdateStatusCheckProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdateStatusCheckProtectionParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposUpdateStatusCheckProtectionBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposUpdateStatusCheckProtection(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_status_check_policy], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveStatusCheckProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.delete( + "reposRemoveStatusCheckProtection", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveStatusCheckProtectionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposRemoveStatusCheckProtection(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -52973,484 +38891,78 @@ export function bootstrap( } ) - const reposListBranchesParamSchema = z.object({ + const reposGetAllStatusCheckContextsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const reposListBranchesQuerySchema = z.object({ - protected: z.coerce.boolean().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + branch: z.coerce.string(), }) router.get( - "reposListBranches", - "/repos/:owner/:repo/branches", + "reposGetAllStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", async (ctx, next) => { const input = { - params: parseRequestInput(reposListBranchesParamSchema, ctx.params), - query: parseRequestInput(reposListBranchesQuerySchema, ctx.query), + params: parseRequestInput( + reposGetAllStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListBranches( + const { status, body } = + await implementation.reposGetAllStatusCheckContexts(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposAddStatusCheckContextsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposAddStatusCheckContextsBodySchema = z.union([ + z.object({ contexts: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.post( + "reposAddStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposAddStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposAddStatusCheckContextsBodySchema, + ctx.body + ), + } + + const { status, body } = await implementation.reposAddStatusCheckContexts( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - protected: z.coerce.boolean(), - protection: z - .object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce - .number() - .optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce - .number() - .optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce - .number() - .optional(), - require_last_push_approval: z.coerce - .boolean() - .optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce - .string() - .optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }) - .optional(), - protection_url: z.coerce.string().optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", z.array(z.coerce.string())], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -53459,592 +38971,122 @@ export function bootstrap( } ) - const reposGetBranchParamSchema = z.object({ + const reposSetStatusCheckContextsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposSetStatusCheckContextsBodySchema = z.union([ + z.object({ contexts: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.put( + "reposSetStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposSetStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposSetStatusCheckContextsBodySchema, + ctx.body + ), + } + + const { status, body } = await implementation.reposSetStatusCheckContexts( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveStatusCheckContextsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveStatusCheckContextsBodySchema = z.union([ + z.object({ contexts: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveStatusCheckContexts", + "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveStatusCheckContextsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveStatusCheckContextsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposRemoveStatusCheckContexts(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) router.get( - "reposGetBranch", - "/repos/:owner/:repo/branches/:branch", + "reposGetAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetBranchParamSchema, ctx.params), + params: parseRequestInput( + reposGetAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetBranch(input, ctx) + const { status, body } = await implementation.reposGetAccessRestrictions( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - name: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - _links: z.object({ - html: z.coerce.string(), - self: z.coerce.string(), - }), - protected: z.coerce.boolean(), - protection: z.object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce - .number() - .optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }), - protection_url: z.coerce.string(), - pattern: z.coerce.string().optional(), - required_approving_review_count: z.coerce.number().optional(), - }), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_branch_restriction_policy], + ["404", s_basic_error], ], undefined )(status, body) @@ -54053,27347 +39095,114 @@ export function bootstrap( } ) - const reposGetBranchProtectionParamSchema = z.object({ + const reposDeleteAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), branch: z.coerce.string(), }) - router.get( - "reposGetBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetBranchProtection( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposUpdateBranchProtectionBodySchema = z.object({ - required_status_checks: z.object({ - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z - .array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number().optional(), - }) - ) - .optional(), - }), - enforce_admins: z.coerce.boolean(), - required_pull_request_reviews: z.object({ - dismissal_restrictions: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean().optional(), - require_code_owner_reviews: z.coerce.boolean().optional(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - bypass_pull_request_allowances: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - }), - restrictions: z.object({ - users: z.array(z.coerce.string()), - teams: z.array(z.coerce.string()), - apps: z.array(z.coerce.string()).optional(), - }), - required_linear_history: z.coerce.boolean().optional(), - allow_force_pushes: z.coerce.boolean().optional(), - allow_deletions: z.coerce.boolean().optional(), - block_creations: z.coerce.boolean().optional(), - required_conversation_resolution: z.coerce.boolean().optional(), - lock_branch: z.coerce.boolean().optional(), - allow_fork_syncing: z.coerce.boolean().optional(), - }) - - router.put( - "reposUpdateBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdateBranchProtectionBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposUpdateBranchProtection( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - required_status_checks: z - .object({ - url: z.coerce.string(), - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string(), - }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string(), - dismiss_stale_reviews: z.coerce.boolean().optional(), - require_code_owner_reviews: z.coerce.boolean().optional(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - dismissal_restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - users: z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - }) - .optional(), - required_signatures: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - enforce_admins: z - .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean() }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeleteBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteBranchProtection( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetAdminBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetAdminBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAdminBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetAdminBranchProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposSetAdminBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.post( - "reposSetAdminBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetAdminBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposSetAdminBranchProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteAdminBranchProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeleteAdminBranchProtection", - "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteAdminBranchProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeleteAdminBranchProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetPullRequestReviewProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetPullRequestReviewProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetPullRequestReviewProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetPullRequestReviewProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdatePullRequestReviewProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposUpdatePullRequestReviewProtectionBodySchema = z - .object({ - dismissal_restrictions: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean().optional(), - require_code_owner_reviews: z.coerce.boolean().optional(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - bypass_pull_request_allowances: z - .object({ - users: z.array(z.coerce.string()).optional(), - teams: z.array(z.coerce.string()).optional(), - apps: z.array(z.coerce.string()).optional(), - }) - .optional(), - }) - .optional() - - router.patch( - "reposUpdatePullRequestReviewProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdatePullRequestReviewProtectionParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdatePullRequestReviewProtectionBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdatePullRequestReviewProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce.number().optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeletePullRequestReviewProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeletePullRequestReviewProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeletePullRequestReviewProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeletePullRequestReviewProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetCommitSignatureProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetCommitSignatureProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_signatures", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCommitSignatureProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetCommitSignatureProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateCommitSignatureProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.post( - "reposCreateCommitSignatureProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_signatures", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateCommitSignatureProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposCreateCommitSignatureProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ url: z.coerce.string(), enabled: z.coerce.boolean() }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteCommitSignatureProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeleteCommitSignatureProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_signatures", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteCommitSignatureProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeleteCommitSignatureProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetStatusChecksProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetStatusChecksProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetStatusChecksProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetStatusChecksProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateStatusCheckProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposUpdateStatusCheckProtectionBodySchema = z - .object({ - strict: z.coerce.boolean().optional(), - contexts: z.array(z.coerce.string()).optional(), - checks: z - .array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number().optional(), - }) - ) - .optional(), - }) - .optional() - - router.patch( - "reposUpdateStatusCheckProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateStatusCheckProtectionParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdateStatusCheckProtectionBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdateStatusCheckProtection(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - strict: z.coerce.boolean(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRemoveStatusCheckProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposRemoveStatusCheckProtection", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRemoveStatusCheckProtectionParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposRemoveStatusCheckProtection(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposGetAllStatusCheckContextsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetAllStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAllStatusCheckContextsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetAllStatusCheckContexts(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposAddStatusCheckContextsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposAddStatusCheckContextsBodySchema = z.union([ - z.object({ contexts: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposAddStatusCheckContextsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposAddStatusCheckContextsBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposAddStatusCheckContexts( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposSetStatusCheckContextsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposSetStatusCheckContextsBodySchema = z.union([ - z.object({ contexts: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetStatusCheckContextsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposSetStatusCheckContextsBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposSetStatusCheckContexts( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRemoveStatusCheckContextsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposRemoveStatusCheckContextsBodySchema = z.union([ - z.object({ contexts: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.delete( - "reposRemoveStatusCheckContexts", - "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRemoveStatusCheckContextsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposRemoveStatusCheckContextsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposRemoveStatusCheckContexts(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetAccessRestrictions( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.delete( - "reposDeleteAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeleteAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposGetAppsWithAccessToProtectedBranchParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetAppsWithAccessToProtectedBranch", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAppsWithAccessToProtectedBranchParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetAppsWithAccessToProtectedBranch(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposAddAppAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposAddAppAccessRestrictionsBodySchema = z.union([ - z.object({ apps: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddAppAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposAddAppAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposAddAppAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposAddAppAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposSetAppAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposSetAppAccessRestrictionsBodySchema = z.union([ - z.object({ apps: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetAppAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetAppAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposSetAppAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposSetAppAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRemoveAppAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposRemoveAppAccessRestrictionsBodySchema = z.union([ - z.object({ apps: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.delete( - "reposRemoveAppAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRemoveAppAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposRemoveAppAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposRemoveAppAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetTeamsWithAccessToProtectedBranchParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetTeamsWithAccessToProtectedBranch", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetTeamsWithAccessToProtectedBranchParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetTeamsWithAccessToProtectedBranch( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposAddTeamAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposAddTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddTeamAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposAddTeamAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposAddTeamAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposAddTeamAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposSetTeamAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposSetTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetTeamAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetTeamAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposSetTeamAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposSetTeamAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRemoveTeamAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposRemoveTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.delete( - "reposRemoveTeamAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRemoveTeamAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposRemoveTeamAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposRemoveTeamAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetUsersWithAccessToProtectedBranchParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - router.get( - "reposGetUsersWithAccessToProtectedBranch", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetUsersWithAccessToProtectedBranchParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetUsersWithAccessToProtectedBranch( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposAddUserAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposAddUserAccessRestrictionsBodySchema = z.union([ - z.object({ users: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.post( - "reposAddUserAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposAddUserAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposAddUserAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposAddUserAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposSetUserAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposSetUserAccessRestrictionsBodySchema = z.union([ - z.object({ users: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.put( - "reposSetUserAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposSetUserAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposSetUserAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposSetUserAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRemoveUserAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposRemoveUserAccessRestrictionsBodySchema = z.union([ - z.object({ users: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) - - router.delete( - "reposRemoveUserAccessRestrictions", - "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRemoveUserAccessRestrictionsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposRemoveUserAccessRestrictionsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposRemoveUserAccessRestrictions(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRenameBranchParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposRenameBranchBodySchema = z.object({ new_name: z.coerce.string() }) - - router.post( - "reposRenameBranch", - "/repos/:owner/:repo/branches/:branch/rename", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposRenameBranchParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposRenameBranchBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposRenameBranch( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - name: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - _links: z.object({ - html: z.coerce.string(), - self: z.coerce.string(), - }), - protected: z.coerce.boolean(), - protection: z.object({ - url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), - }) - .optional(), - enforce_admins: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - required_pull_request_reviews: z - .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) - .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce - .number() - .optional(), - require_last_push_approval: z.coerce.boolean().optional(), - }) - .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), - }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - }), - protection_url: z.coerce.string(), - pattern: z.coerce.string().optional(), - required_approving_review_count: z.coerce.number().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksCreateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const checksCreateBodySchema = z.union([ - z.object({ status: z.object({}) }), - z.object({ status: z.object({}).optional() }), - ]) - - router.post( - "checksCreate", - "/repos/:owner/:repo/check-runs", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksCreateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(checksCreateBodySchema, ctx.body), - } - - const { status, body } = await implementation.checksCreate(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksGetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_run_id: z.coerce.number(), - }) - - router.get( - "checksGet", - "/repos/:owner/:repo/check-runs/:checkRunId", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksGetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.checksGet(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksUpdateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_run_id: z.coerce.number(), - }) - - const checksUpdateBodySchema = z.object({ - name: z.coerce.string().optional(), - details_url: z.coerce.string().optional(), - external_id: z.coerce.string().optional(), - started_at: z.coerce.string().datetime({ offset: true }).optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - conclusion: z - .enum([ - "action_required", - "cancelled", - "failure", - "neutral", - "success", - "skipped", - "stale", - "timed_out", - ]) - .optional(), - completed_at: z.coerce.string().datetime({ offset: true }).optional(), - output: z - .object({ - title: z.coerce.string().optional(), - summary: z.coerce.string(), - text: z.coerce.string().optional(), - annotations: z - .array( - z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - annotation_level: z.enum(["notice", "warning", "failure"]), - message: z.coerce.string(), - title: z.coerce.string().optional(), - raw_details: z.coerce.string().optional(), - }) - ) - .optional(), - images: z - .array( - z.object({ - alt: z.coerce.string(), - image_url: z.coerce.string(), - caption: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional(), - actions: z - .array( - z.object({ - label: z.coerce.string(), - description: z.coerce.string(), - identifier: z.coerce.string(), - }) - ) - .optional(), - }) - - router.patch( - "checksUpdate", - "/repos/:owner/:repo/check-runs/:checkRunId", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(checksUpdateBodySchema, ctx.body), - } - - const { status, body } = await implementation.checksUpdate(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksListAnnotationsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_run_id: z.coerce.number(), - }) - - const checksListAnnotationsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "checksListAnnotations", - "/repos/:owner/:repo/check-runs/:checkRunId/annotations", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksListAnnotationsParamSchema, ctx.params), - query: parseRequestInput(checksListAnnotationsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListAnnotations( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number(), - end_column: z.coerce.number(), - annotation_level: z.coerce.string(), - title: z.coerce.string(), - message: z.coerce.string(), - raw_details: z.coerce.string(), - blob_href: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksRerequestRunParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_run_id: z.coerce.number(), - }) - - router.post( - "checksRerequestRun", - "/repos/:owner/:repo/check-runs/:checkRunId/rerequest", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksRerequestRunParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.checksRerequestRun( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksCreateSuiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const checksCreateSuiteBodySchema = z.object({ head_sha: z.coerce.string() }) - - router.post( - "checksCreateSuite", - "/repos/:owner/:repo/check-suites", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksCreateSuiteParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(checksCreateSuiteBodySchema, ctx.body), - } - - const { status, body } = await implementation.checksCreateSuite( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksSetSuitesPreferencesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const checksSetSuitesPreferencesBodySchema = z.object({ - auto_trigger_checks: z - .array( - z.object({ app_id: z.coerce.number(), setting: z.coerce.boolean() }) - ) - .optional(), - }) - - router.patch( - "checksSetSuitesPreferences", - "/repos/:owner/:repo/check-suites/preferences", - async (ctx, next) => { - const input = { - params: parseRequestInput( - checksSetSuitesPreferencesParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(checksSetSuitesPreferencesBodySchema, ctx.body), - } - - const { status, body } = await implementation.checksSetSuitesPreferences( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - preferences: z.object({ - auto_trigger_checks: z - .array( - z.object({ - app_id: z.coerce.number(), - setting: z.coerce.boolean(), - }) - ) - .optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksGetSuiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_suite_id: z.coerce.number(), - }) - - router.get( - "checksGetSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksGetSuiteParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.checksGetSuite(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksListForSuiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_suite_id: z.coerce.number(), - }) - - const checksListForSuiteQuerySchema = z.object({ - check_name: z.coerce.string().optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - filter: z.enum(["latest", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "checksListForSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId/check-runs", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksListForSuiteParamSchema, ctx.params), - query: parseRequestInput(checksListForSuiteQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListForSuite( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - check_runs: z.array( - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksRerequestSuiteParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - check_suite_id: z.coerce.number(), - }) - - router.post( - "checksRerequestSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId/rerequest", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksRerequestSuiteParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.checksRerequestSuite( - input, - ctx - ) - - ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const codeScanningListAlertsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codeScanningListAlertsForRepoQuerySchema = z.object({ - tool_name: z.coerce.string().optional(), - tool_guid: z.coerce.string().optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - direction: z.enum(["asc", "desc"]).optional(), - sort: z.enum(["created", "updated"]).optional(), - state: z.enum(["open", "closed", "dismissed", "fixed"]).optional(), - severity: z - .enum(["critical", "high", "medium", "low", "warning", "note", "error"]) - .optional(), - }) - - router.get( - "codeScanningListAlertsForRepo", - "/repos/:owner/:repo/code-scanning/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListAlertsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListAlertsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListAlertsForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - severity: z - .enum(["none", "note", "warning", "error"]) - .optional(), - description: z.coerce.string().optional(), - }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }), - }) - ), - ], - ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningGetAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - router.get( - "codeScanningGetAlert", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(codeScanningGetAlertParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codeScanningGetAlert( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce.string().datetime({ offset: true }).optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - severity: z - .enum(["none", "note", "warning", "error"]) - .optional(), - security_severity_level: z - .enum(["low", "medium", "high", "critical"]) - .optional(), - description: z.coerce.string().optional(), - full_description: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - help: z.coerce.string().optional(), - help_uri: z.coerce.string().optional(), - }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }), - }), - ], - ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningUpdateAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const codeScanningUpdateAlertBodySchema = z.object({ - state: z.enum(["open", "dismissed"]), - dismissed_reason: z - .enum(["null", "false positive", "won't fix", "used in tests"]) - .optional(), - dismissed_comment: z.coerce.string().optional(), - }) - - router.patch( - "codeScanningUpdateAlert", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningUpdateAlertParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(codeScanningUpdateAlertBodySchema, ctx.body), - } - - const { status, body } = await implementation.codeScanningUpdateAlert( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce.string().datetime({ offset: true }).optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - severity: z - .enum(["none", "note", "warning", "error"]) - .optional(), - security_severity_level: z - .enum(["low", "medium", "high", "critical"]) - .optional(), - description: z.coerce.string().optional(), - full_description: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - help: z.coerce.string().optional(), - help_uri: z.coerce.string().optional(), - }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningListAlertInstancesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const codeScanningListAlertInstancesQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - }) - - router.get( - "codeScanningListAlertInstances", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber/instances", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListAlertInstancesParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListAlertInstancesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListAlertInstances(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningListRecentAnalysesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codeScanningListRecentAnalysesQuerySchema = z.object({ - tool_name: z.coerce.string().optional(), - tool_guid: z.coerce.string().optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - ref: z.coerce.string().optional(), - sarif_id: z.coerce.string().optional(), - direction: z.enum(["asc", "desc"]).optional(), - sort: z.enum(["created"]).optional(), - }) - - router.get( - "codeScanningListRecentAnalyses", - "/repos/:owner/:repo/code-scanning/analyses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListRecentAnalysesParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListRecentAnalysesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListRecentAnalyses(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref: z.coerce.string(), - commit_sha: z.coerce.string(), - analysis_key: z.coerce.string(), - environment: z.coerce.string(), - category: z.coerce.string().optional(), - error: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - results_count: z.coerce.number(), - rules_count: z.coerce.number(), - id: z.coerce.number(), - url: z.coerce.string(), - sarif_id: z.coerce.string(), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - deletable: z.coerce.boolean(), - warning: z.coerce.string(), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningGetAnalysisParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - analysis_id: z.coerce.number(), - }) - - router.get( - "codeScanningGetAnalysis", - "/repos/:owner/:repo/code-scanning/analyses/:analysisId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningGetAnalysisParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codeScanningGetAnalysis( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["200", z.object({})], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningDeleteAnalysisParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - analysis_id: z.coerce.number(), - }) - - const codeScanningDeleteAnalysisQuerySchema = z.object({ - confirm_delete: z.coerce.string().optional(), - }) - - router.delete( - "codeScanningDeleteAnalysis", - "/repos/:owner/:repo/code-scanning/analyses/:analysisId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningDeleteAnalysisParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningDeleteAnalysisQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.codeScanningDeleteAnalysis( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - next_analysis_url: z.coerce.string(), - confirm_delete_url: z.coerce.string(), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningListCodeqlDatabasesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "codeScanningListCodeqlDatabases", - "/repos/:owner/:repo/code-scanning/codeql/databases", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListCodeqlDatabasesParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListCodeqlDatabases(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - language: z.coerce.string(), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content_type: z.coerce.string(), - size: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningGetCodeqlDatabaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - language: z.coerce.string(), - }) - - router.get( - "codeScanningGetCodeqlDatabase", - "/repos/:owner/:repo/code-scanning/codeql/databases/:language", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningGetCodeqlDatabaseParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codeScanningGetCodeqlDatabase(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - language: z.coerce.string(), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content_type: z.coerce.string(), - size: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - }), - ], - ["302", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningUploadSarifParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codeScanningUploadSarifBodySchema = z.object({ - commit_sha: z.coerce.string(), - ref: z.coerce.string(), - sarif: z.coerce.string(), - checkout_uri: z.coerce.string().optional(), - started_at: z.coerce.string().datetime({ offset: true }).optional(), - tool_name: z.coerce.string().optional(), - validate: z.coerce.boolean().optional(), - }) - - router.post( - "codeScanningUploadSarif", - "/repos/:owner/:repo/code-scanning/sarifs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningUploadSarifParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(codeScanningUploadSarifBodySchema, ctx.body), - } - - const { status, body } = await implementation.codeScanningUploadSarif( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "202", - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }), - ], - ["400", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["413", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codeScanningGetSarifParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - sarif_id: z.coerce.string(), - }) - - router.get( - "codeScanningGetSarif", - "/repos/:owner/:repo/code-scanning/sarifs/:sarifId", - async (ctx, next) => { - const input = { - params: parseRequestInput(codeScanningGetSarifParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codeScanningGetSarif( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - processing_status: z - .enum(["pending", "complete", "failed"]) - .optional(), - analyses_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCodeownersErrorsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCodeownersErrorsQuerySchema = z.object({ - ref: z.coerce.string().optional(), - }) - - router.get( - "reposCodeownersErrors", - "/repos/:owner/:repo/codeowners/errors", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCodeownersErrorsParamSchema, ctx.params), - query: parseRequestInput(reposCodeownersErrorsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposCodeownersErrors( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - errors: z.array( - z.object({ - line: z.coerce.number(), - column: z.coerce.number(), - source: z.coerce.string().optional(), - kind: z.coerce.string(), - suggestion: z.coerce.string().optional(), - message: z.coerce.string(), - path: z.coerce.string(), - }) - ), - }), - ], - ["404", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesListInRepositoryForAuthenticatedUserParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesListInRepositoryForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "codespacesListInRepositoryForAuthenticatedUser", - "/repos/:owner/:repo/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesListInRepositoryForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListInRepositoryForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesListInRepositoryForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce - .string() - .optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesCreateWithRepoForAuthenticatedUserParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesCreateWithRepoForAuthenticatedUserBodySchema = z.object({ - ref: z.coerce.string().optional(), - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - multi_repo_permissions_opt_out: z.coerce.boolean().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - display_name: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - }) - - router.post( - "codespacesCreateWithRepoForAuthenticatedUser", - "/repos/:owner/:repo/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesCreateWithRepoForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - codespacesCreateWithRepoForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.codespacesCreateWithRepoForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "202", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema = - z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) - - const codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema = - z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "codespacesListDevcontainersInRepositoryForAuthenticatedUser", - "/repos/:owner/:repo/codespaces/devcontainers", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesListDevcontainersInRepositoryForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - devcontainers: z.array( - z.object({ - path: z.coerce.string(), - name: z.coerce.string().optional(), - }) - ), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesRepoMachinesForAuthenticatedUserParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesRepoMachinesForAuthenticatedUserQuerySchema = z.object({ - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - }) - - router.get( - "codespacesRepoMachinesForAuthenticatedUser", - "/repos/:owner/:repo/codespaces/machines", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesRepoMachinesForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesRepoMachinesForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesRepoMachinesForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - machines: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }) - ), - }), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesPreFlightWithRepoForAuthenticatedUserParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema = z.object({ - ref: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - }) - - router.get( - "codespacesPreFlightWithRepoForAuthenticatedUser", - "/repos/:owner/:repo/codespaces/new", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesPreFlightWithRepoForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesPreFlightWithRepoForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - billable_owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - defaults: z - .object({ - location: z.coerce.string(), - devcontainer_path: z.coerce.string(), - }) - .optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesListRepoSecretsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const codespacesListRepoSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "codespacesListRepoSecrets", - "/repos/:owner/:repo/codespaces/secrets", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesListRepoSecretsParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListRepoSecretsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.codespacesListRepoSecrets( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesGetRepoPublicKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "codespacesGetRepoPublicKey", - "/repos/:owner/:repo/codespaces/secrets/public-key", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesGetRepoPublicKeyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codespacesGetRepoPublicKey( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesGetRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.get( - "codespacesGetRepoSecret", - "/repos/:owner/:repo/codespaces/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesGetRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codespacesGetRepoSecret( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesCreateOrUpdateRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const codespacesCreateOrUpdateRepoSecretBodySchema = z.object({ - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string().optional(), - }) - - router.put( - "codespacesCreateOrUpdateRepoSecret", - "/repos/:owner/:repo/codespaces/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesCreateOrUpdateRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - codespacesCreateOrUpdateRepoSecretBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.codespacesCreateOrUpdateRepoSecret(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesDeleteRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.delete( - "codespacesDeleteRepoSecret", - "/repos/:owner/:repo/codespaces/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesDeleteRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.codespacesDeleteRepoSecret( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposListCollaboratorsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListCollaboratorsQuerySchema = z.object({ - affiliation: z.enum(["outside", "direct", "all"]).optional(), - permission: z - .enum(["pull", "triage", "push", "maintain", "admin"]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCollaborators", - "/repos/:owner/:repo/collaborators", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCollaboratorsParamSchema, - ctx.params - ), - query: parseRequestInput(reposListCollaboratorsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListCollaborators( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - admin: z.coerce.boolean(), - }) - .optional(), - role_name: z.coerce.string(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCheckCollaboratorParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - username: z.coerce.string(), - }) - - router.get( - "reposCheckCollaborator", - "/repos/:owner/:repo/collaborators/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCheckCollaboratorParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposCheckCollaborator( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposAddCollaboratorParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - username: z.coerce.string(), - }) - - const reposAddCollaboratorBodySchema = z - .object({ permission: z.coerce.string().optional() }) - .optional() - - router.put( - "reposAddCollaborator", - "/repos/:owner/:repo/collaborators/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposAddCollaboratorParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposAddCollaboratorBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposAddCollaborator( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }), - ], - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRemoveCollaboratorParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - username: z.coerce.string(), - }) - - router.delete( - "reposRemoveCollaborator", - "/repos/:owner/:repo/collaborators/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRemoveCollaboratorParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposRemoveCollaborator( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposGetCollaboratorPermissionLevelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - username: z.coerce.string(), - }) - - router.get( - "reposGetCollaboratorPermissionLevel", - "/repos/:owner/:repo/collaborators/:username/permission", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCollaboratorPermissionLevelParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetCollaboratorPermissionLevel(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - permission: z.coerce.string(), - role_name: z.coerce.string(), - user: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - admin: z.coerce.boolean(), - }) - .optional(), - role_name: z.coerce.string(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListCommitCommentsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListCommitCommentsForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommitCommentsForRepo", - "/repos/:owner/:repo/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommitCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommitCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListCommitCommentsForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - router.get( - "reposGetCommitComment", - "/repos/:owner/:repo/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetCommitCommentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetCommitComment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reposUpdateCommitCommentBodySchema = z.object({ - body: z.coerce.string(), - }) - - router.patch( - "reposUpdateCommitComment", - "/repos/:owner/:repo/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposUpdateCommitCommentBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdateCommitComment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteCommitComment", - "/repos/:owner/:repo/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteCommitComment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reactionsListForCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsListForCommitCommentQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reactionsListForCommitComment", - "/repos/:owner/:repo/comments/:commentId/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsListForCommitCommentParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForCommitCommentQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reactionsListForCommitComment(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reactionsCreateForCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsCreateForCommitCommentBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) - - router.post( - "reactionsCreateForCommitComment", - "/repos/:owner/:repo/comments/:commentId/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reactionsCreateForCommitCommentBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reactionsCreateForCommitComment(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reactionsDeleteForCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - reaction_id: z.coerce.number(), - }) - - router.delete( - "reactionsDeleteForCommitComment", - "/repos/:owner/:repo/comments/:commentId/reactions/:reactionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsDeleteForCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reactionsDeleteForCommitComment(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposListCommitsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListCommitsQuerySchema = z.object({ - sha: z.coerce.string().optional(), - path: z.coerce.string().optional(), - author: z.coerce.string().optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - until: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommits", - "/repos/:owner/:repo/commits", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListCommitsParamSchema, ctx.params), - query: parseRequestInput(reposListCommitsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListCommits(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - ), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListBranchesForHeadCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - router.get( - "reposListBranchesForHeadCommit", - "/repos/:owner/:repo/commits/:commitSha/branches-where-head", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListBranchesForHeadCommitParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposListBranchesForHeadCommit(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - protected: z.coerce.boolean(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListCommentsForCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - const reposListCommentsForCommitQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommentsForCommit", - "/repos/:owner/:repo/commits/:commitSha/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommentsForCommitParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommentsForCommitQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.reposListCommentsForCommit( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateCommitCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - const reposCreateCommitCommentBodySchema = z.object({ - body: z.coerce.string(), - path: z.coerce.string().optional(), - position: z.coerce.number().optional(), - line: z.coerce.number().optional(), - }) - - router.post( - "reposCreateCommitComment", - "/repos/:owner/:repo/commits/:commitSha/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateCommitCommentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateCommitCommentBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateCommitComment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListPullRequestsAssociatedWithCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - const reposListPullRequestsAssociatedWithCommitQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListPullRequestsAssociatedWithCommit", - "/repos/:owner/:repo/commits/:commitSha/pulls", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListPullRequestsAssociatedWithCommitParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListPullRequestsAssociatedWithCommitQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListPullRequestsAssociatedWithCommit( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposGetCommitQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - }) - - router.get( - "reposGetCommit", - "/repos/:owner/:repo/commits/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetCommitParamSchema, ctx.params), - query: parseRequestInput(reposGetCommitQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposGetCommit(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksListForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const checksListForRefQuerySchema = z.object({ - check_name: z.coerce.string().optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - filter: z.enum(["latest", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - app_id: z.coerce.number().optional(), - }) - - router.get( - "checksListForRef", - "/repos/:owner/:repo/commits/:ref/check-runs", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksListForRefParamSchema, ctx.params), - query: parseRequestInput(checksListForRefQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListForRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - check_runs: z.array( - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksListSuitesForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const checksListSuitesForRefQuerySchema = z.object({ - app_id: z.coerce.number().optional(), - check_name: z.coerce.string().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "checksListSuitesForRef", - "/repos/:owner/:repo/commits/:ref/check-suites", - async (ctx, next) => { - const input = { - params: parseRequestInput( - checksListSuitesForRefParamSchema, - ctx.params - ), - query: parseRequestInput(checksListSuitesForRefQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListSuitesForRef( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - check_suites: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetCombinedStatusForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposGetCombinedStatusForRefQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposGetCombinedStatusForRef", - "/repos/:owner/:repo/commits/:ref/status", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCombinedStatusForRefParamSchema, - ctx.params - ), - query: parseRequestInput( - reposGetCombinedStatusForRefQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposGetCombinedStatusForRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - state: z.coerce.string(), - statuses: z.array( - z.object({ - description: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.coerce.string(), - context: z.coerce.string(), - target_url: z.coerce.string(), - required: z.coerce.boolean().optional(), - avatar_url: z.coerce.string(), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - sha: z.coerce.string(), - total_count: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - commit_url: z.coerce.string(), - url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListCommitStatusesForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposListCommitStatusesForRefQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListCommitStatusesForRef", - "/repos/:owner/:repo/commits/:ref/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommitStatusesForRefParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommitStatusesForRefQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListCommitStatusesForRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - avatar_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.coerce.string(), - description: z.coerce.string(), - target_url: z.coerce.string(), - context: z.coerce.string(), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetCommunityProfileMetricsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "reposGetCommunityProfileMetrics", - "/repos/:owner/:repo/community/profile", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetCommunityProfileMetricsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetCommunityProfileMetrics(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - health_percentage: z.coerce.number(), - description: z.coerce.string(), - documentation: z.coerce.string(), - files: z.object({ - code_of_conduct: z.object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }), - code_of_conduct_file: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - contributing: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - readme: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - issue_template: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - pull_request_template: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - }), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - content_reports_enabled: z.coerce.boolean().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCompareCommitsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - basehead: z.coerce.string(), - }) - - const reposCompareCommitsQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - }) - - router.get( - "reposCompareCommits", - "/repos/:owner/:repo/compare/:basehead", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCompareCommitsParamSchema, ctx.params), - query: parseRequestInput(reposCompareCommitsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposCompareCommits( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - permalink_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - base_commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - merge_base_commit: z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - status: z.enum(["diverged", "ahead", "behind", "identical"]), - ahead_by: z.coerce.number(), - behind_by: z.coerce.number(), - total_commits: z.coerce.number(), - commits: z.array( - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - ), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetContentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - path: z.coerce.string(), - }) - - const reposGetContentQuerySchema = z.object({ - ref: z.coerce.string().optional(), - }) - - router.get( - "reposGetContent", - "/repos/:owner/:repo/contents/:path", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetContentParamSchema, ctx.params), - query: parseRequestInput(reposGetContentQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposGetContent(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.union([ - z.array( - z.object({ - type: z.enum(["dir", "file", "submodule", "symlink"]), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string().optional(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - }) - ), - z.object({ - type: z.enum(["file"]), - encoding: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - target: z.coerce.string().optional(), - submodule_git_url: z.coerce.string().optional(), - }), - z.object({ - type: z.enum(["symlink"]), - target: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - }), - z.object({ - type: z.enum(["submodule"]), - submodule_git_url: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - }), - ]), - ], - ["302", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateOrUpdateFileContentsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - path: z.coerce.string(), - }) - - const reposCreateOrUpdateFileContentsBodySchema = z.object({ - message: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - committer: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().optional(), - }) - .optional(), - author: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().optional(), - }) - .optional(), - }) - - router.put( - "reposCreateOrUpdateFileContents", - "/repos/:owner/:repo/contents/:path", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateOrUpdateFileContentsParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateOrUpdateFileContentsBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposCreateOrUpdateFileContents(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - content: z.object({ - name: z.coerce.string().optional(), - path: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - download_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - _links: z - .object({ - self: z.coerce.string().optional(), - git: z.coerce.string().optional(), - html: z.coerce.string().optional(), - }) - .optional(), - }), - commit: z.object({ - sha: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - author: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - committer: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - tree: z - .object({ - url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - .optional(), - parents: z - .array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - ) - .optional(), - verification: z - .object({ - verified: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - signature: z.coerce.string().optional(), - payload: z.coerce.string().optional(), - }) - .optional(), - }), - }), - ], - [ - "201", - z.object({ - content: z.object({ - name: z.coerce.string().optional(), - path: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - download_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - _links: z - .object({ - self: z.coerce.string().optional(), - git: z.coerce.string().optional(), - html: z.coerce.string().optional(), - }) - .optional(), - }), - commit: z.object({ - sha: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - author: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - committer: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - tree: z - .object({ - url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - .optional(), - parents: z - .array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - ) - .optional(), - verification: z - .object({ - verified: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - signature: z.coerce.string().optional(), - payload: z.coerce.string().optional(), - }) - .optional(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteFileParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - path: z.coerce.string(), - }) - - const reposDeleteFileBodySchema = z.object({ - message: z.coerce.string(), - sha: z.coerce.string(), - branch: z.coerce.string().optional(), - committer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - author: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - }) - - router.delete( - "reposDeleteFile", - "/repos/:owner/:repo/contents/:path", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteFileParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposDeleteFileBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposDeleteFile(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - content: z.object({ - name: z.coerce.string().optional(), - path: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - download_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - _links: z - .object({ - self: z.coerce.string().optional(), - git: z.coerce.string().optional(), - html: z.coerce.string().optional(), - }) - .optional(), - }), - commit: z.object({ - sha: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - author: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - committer: z - .object({ - date: z.coerce.string().optional(), - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - tree: z - .object({ - url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - .optional(), - parents: z - .array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - ) - .optional(), - verification: z - .object({ - verified: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - signature: z.coerce.string().optional(), - payload: z.coerce.string().optional(), - }) - .optional(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListContributorsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListContributorsQuerySchema = z.object({ - anon: z.coerce.string().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListContributors", - "/repos/:owner/:repo/contributors", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListContributorsParamSchema, ctx.params), - query: parseRequestInput(reposListContributorsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListContributors( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string(), - site_admin: z.coerce.boolean().optional(), - contributions: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - ), - ], - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotListAlertsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const dependabotListAlertsForRepoQuerySchema = z.object({ - state: z.coerce.string().optional(), - severity: z.coerce.string().optional(), - ecosystem: z.coerce.string().optional(), - package: z.coerce.string().optional(), - manifest: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - first: z.coerce.number().optional(), - last: z.coerce.number().optional(), - }) - - router.get( - "dependabotListAlertsForRepo", - "/repos/:owner/:repo/dependabot/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotListAlertsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - dependabotListAlertsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.dependabotListAlertsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["304", z.void()], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotGetAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - router.get( - "dependabotGetAlert", - "/repos/:owner/:repo/dependabot/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(dependabotGetAlertParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotGetAlert( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotUpdateAlertParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const dependabotUpdateAlertBodySchema = z.object({ - state: z.enum(["dismissed", "open"]), - dismissed_reason: z - .enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]) - .optional(), - dismissed_comment: z.coerce.string().optional(), - }) - - router.patch( - "dependabotUpdateAlert", - "/repos/:owner/:repo/dependabot/alerts/:alertNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(dependabotUpdateAlertParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(dependabotUpdateAlertBodySchema, ctx.body), - } - - const { status, body } = await implementation.dependabotUpdateAlert( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotListRepoSecretsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const dependabotListRepoSecretsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "dependabotListRepoSecrets", - "/repos/:owner/:repo/dependabot/secrets", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotListRepoSecretsParamSchema, - ctx.params - ), - query: parseRequestInput( - dependabotListRepoSecretsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.dependabotListRepoSecrets( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotGetRepoPublicKeyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "dependabotGetRepoPublicKey", - "/repos/:owner/:repo/dependabot/secrets/public-key", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotGetRepoPublicKeyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotGetRepoPublicKey( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ key_id: z.coerce.string(), key: z.coerce.string() }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotGetRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.get( - "dependabotGetRepoSecret", - "/repos/:owner/:repo/dependabot/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotGetRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotGetRepoSecret( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotCreateOrUpdateRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - const dependabotCreateOrUpdateRepoSecretBodySchema = z.object({ - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string().optional(), - }) - - router.put( - "dependabotCreateOrUpdateRepoSecret", - "/repos/:owner/:repo/dependabot/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotCreateOrUpdateRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - dependabotCreateOrUpdateRepoSecretBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.dependabotCreateOrUpdateRepoSecret(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependabotDeleteRepoSecretParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - secret_name: z.coerce.string(), - }) - - router.delete( - "dependabotDeleteRepoSecret", - "/repos/:owner/:repo/dependabot/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotDeleteRepoSecretParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.dependabotDeleteRepoSecret( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const dependencyGraphDiffRangeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - basehead: z.coerce.string(), - }) - - const dependencyGraphDiffRangeQuerySchema = z.object({ - name: z.coerce.string().optional(), - }) - - router.get( - "dependencyGraphDiffRange", - "/repos/:owner/:repo/dependency-graph/compare/:basehead", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependencyGraphDiffRangeParamSchema, - ctx.params - ), - query: parseRequestInput( - dependencyGraphDiffRangeQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.dependencyGraphDiffRange( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - change_type: z.enum(["added", "removed"]), - manifest: z.coerce.string(), - ecosystem: z.coerce.string(), - name: z.coerce.string(), - version: z.coerce.string(), - package_url: z.coerce.string(), - license: z.coerce.string(), - source_repository_url: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - severity: z.coerce.string(), - advisory_ghsa_id: z.coerce.string(), - advisory_summary: z.coerce.string(), - advisory_url: z.coerce.string(), - }) - ), - scope: z.enum(["unknown", "runtime", "development"]), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const dependencyGraphCreateRepositorySnapshotParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const dependencyGraphCreateRepositorySnapshotBodySchema = z.object({ - version: z.coerce.number(), - job: z.object({ - id: z.coerce.string(), - correlator: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - sha: z.coerce.string(), - ref: z.coerce.string(), - detector: z.object({ - name: z.coerce.string(), - version: z.coerce.string(), - url: z.coerce.string(), - }), - metadata: z.object({}).optional(), - manifests: z.object({}).optional(), - scanned: z.coerce.string().datetime({ offset: true }), - }) - - router.post( - "dependencyGraphCreateRepositorySnapshot", - "/repos/:owner/:repo/dependency-graph/snapshots", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependencyGraphCreateRepositorySnapshotParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - dependencyGraphCreateRepositorySnapshotBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.dependencyGraphCreateRepositorySnapshot(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - created_at: z.coerce.string(), - result: z.coerce.string(), - message: z.coerce.string(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListDeploymentsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListDeploymentsQuerySchema = z.object({ - sha: z.coerce.string().optional(), - ref: z.coerce.string().optional(), - task: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListDeployments", - "/repos/:owner/:repo/deployments", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListDeploymentsParamSchema, ctx.params), - query: parseRequestInput(reposListDeploymentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListDeployments( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateDeploymentBodySchema = z.object({ - ref: z.coerce.string(), - task: z.coerce.string().optional(), - auto_merge: z.coerce.boolean().optional(), - required_contexts: z.array(z.coerce.string()).optional(), - payload: z.union([z.object({}), z.coerce.string()]), - environment: z.coerce.string().optional(), - description: z.coerce.string().optional(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateDeployment", - "/repos/:owner/:repo/deployments", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateDeploymentParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateDeploymentBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateDeployment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }), - ], - ["202", z.object({ message: z.coerce.string().optional() })], - ["409", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - router.get( - "reposGetDeployment", - "/repos/:owner/:repo/deployments/:deploymentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetDeploymentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetDeployment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteDeployment", - "/repos/:owner/:repo/deployments/:deploymentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteDeploymentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteDeployment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListDeploymentStatusesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - const reposListDeploymentStatusesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListDeploymentStatuses", - "/repos/:owner/:repo/deployments/:deploymentId/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListDeploymentStatusesParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListDeploymentStatusesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.reposListDeploymentStatuses( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateDeploymentStatusParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - }) - - const reposCreateDeploymentStatusBodySchema = z.object({ - state: z.enum([ - "error", - "failure", - "inactive", - "in_progress", - "queued", - "pending", - "success", - ]), - target_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - environment: z.enum(["production", "staging", "qa"]).optional(), - environment_url: z.coerce.string().optional(), - auto_inactive: z.coerce.boolean().optional(), - }) - - router.post( - "reposCreateDeploymentStatus", - "/repos/:owner/:repo/deployments/:deploymentId/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateDeploymentStatusParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateDeploymentStatusBodySchema, - ctx.body - ), - } - - const { status, body } = await implementation.reposCreateDeploymentStatus( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetDeploymentStatusParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - deployment_id: z.coerce.number(), - status_id: z.coerce.number(), - }) - - router.get( - "reposGetDeploymentStatus", - "/repos/:owner/:repo/deployments/:deploymentId/statuses/:statusId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetDeploymentStatusParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetDeploymentStatus( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateDispatchEventParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateDispatchEventBodySchema = z.object({ - event_type: z.coerce.string(), - client_payload: z.object({}).optional(), - }) - - router.post( - "reposCreateDispatchEvent", - "/repos/:owner/:repo/dispatches", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateDispatchEventParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateDispatchEventBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateDispatchEvent( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetAllEnvironmentsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposGetAllEnvironmentsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposGetAllEnvironments", - "/repos/:owner/:repo/environments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetAllEnvironmentsParamSchema, - ctx.params - ), - query: parseRequestInput(reposGetAllEnvironmentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposGetAllEnvironments( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number().optional(), - environments: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetEnvironmentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - router.get( - "reposGetEnvironment", - "/repos/:owner/:repo/environments/:environmentName", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetEnvironmentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetEnvironment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateOrUpdateEnvironmentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - const reposCreateOrUpdateEnvironmentBodySchema = z - .object({ - wait_timer: z.coerce.number().optional(), - reviewers: z - .array( - z.object({ - type: z.enum(["User", "Team"]).optional(), - id: z.coerce.number().optional(), - }) - ) - .optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - .optional() - - router.put( - "reposCreateOrUpdateEnvironment", - "/repos/:owner/:repo/environments/:environmentName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateOrUpdateEnvironmentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateOrUpdateEnvironmentBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposCreateOrUpdateEnvironment(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteAnEnvironmentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - router.delete( - "reposDeleteAnEnvironment", - "/repos/:owner/:repo/environments/:environmentName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteAnEnvironmentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteAnEnvironment( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposListDeploymentBranchPoliciesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - const reposListDeploymentBranchPoliciesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListDeploymentBranchPolicies", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListDeploymentBranchPoliciesParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListDeploymentBranchPoliciesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListDeploymentBranchPolicies(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - branch_policies: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - }) - - const reposCreateDeploymentBranchPolicyBodySchema = z.object({ - name: z.coerce.string(), - }) - - router.post( - "reposCreateDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposCreateDeploymentBranchPolicyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposCreateDeploymentBranchPolicy(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }), - ], - ["303", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - branch_policy_id: z.coerce.number(), - }) - - router.get( - "reposGetDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetDeploymentBranchPolicy(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - branch_policy_id: z.coerce.number(), - }) - - const reposUpdateDeploymentBranchPolicyBodySchema = z.object({ - name: z.coerce.string(), - }) - - router.put( - "reposUpdateDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdateDeploymentBranchPolicyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdateDeploymentBranchPolicy(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteDeploymentBranchPolicyParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - environment_name: z.coerce.string(), - branch_policy_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteDeploymentBranchPolicy", - "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteDeploymentBranchPolicyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const activityListRepoEventsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const activityListRepoEventsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListRepoEvents", - "/repos/:owner/:repo/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListRepoEventsParamSchema, - ctx.params - ), - query: parseRequestInput(activityListRepoEventsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.activityListRepoEvents( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListForksParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListForksQuerySchema = z.object({ - sort: z.enum(["newest", "oldest", "stargazers", "watchers"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListForks", - "/repos/:owner/:repo/forks", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListForksParamSchema, ctx.params), - query: parseRequestInput(reposListForksQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListForks(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateForkParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateForkBodySchema = z - .object({ - organization: z.coerce.string().optional(), - name: z.coerce.string().optional(), - default_branch_only: z.coerce.boolean().optional(), - }) - .optional() - - router.post( - "reposCreateFork", - "/repos/:owner/:repo/forks", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateForkParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateForkBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateFork(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "202", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitCreateBlobParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const gitCreateBlobBodySchema = z.object({ - content: z.coerce.string(), - encoding: z.coerce.string().optional(), - }) - - router.post( - "gitCreateBlob", - "/repos/:owner/:repo/git/blobs", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitCreateBlobParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitCreateBlobBodySchema, ctx.body), - } - - const { status, body } = await implementation.gitCreateBlob(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["201", z.object({ url: z.coerce.string(), sha: z.coerce.string() })], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitGetBlobParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - file_sha: z.coerce.string(), - }) - - router.get( - "gitGetBlob", - "/repos/:owner/:repo/git/blobs/:fileSha", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitGetBlobParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gitGetBlob(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - content: z.coerce.string(), - encoding: z.coerce.string(), - url: z.coerce.string(), - sha: z.coerce.string(), - size: z.coerce.number(), - node_id: z.coerce.string(), - highlighted_content: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitCreateCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const gitCreateCommitBodySchema = z.object({ - message: z.coerce.string(), - tree: z.coerce.string(), - parents: z.array(z.coerce.string()).optional(), - author: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional(), - committer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional(), - signature: z.coerce.string().optional(), - }) - - router.post( - "gitCreateCommit", - "/repos/:owner/:repo/git/commits", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitCreateCommitParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitCreateCommitBodySchema, ctx.body), - } - - const { status, body } = await implementation.gitCreateCommit(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - sha: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - author: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), - }), - committer: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), - }), - message: z.coerce.string(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - }) - ), - verification: z.object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - signature: z.coerce.string(), - payload: z.coerce.string(), - }), - html_url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitGetCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - commit_sha: z.coerce.string(), - }) - - router.get( - "gitGetCommit", - "/repos/:owner/:repo/git/commits/:commitSha", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitGetCommitParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gitGetCommit(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - sha: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - author: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), - }), - committer: z.object({ - date: z.coerce.string().datetime({ offset: true }), - email: z.coerce.string(), - name: z.coerce.string(), - }), - message: z.coerce.string(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - }) - ), - verification: z.object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - signature: z.coerce.string(), - payload: z.coerce.string(), - }), - html_url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitListMatchingRefsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - router.get( - "gitListMatchingRefs", - "/repos/:owner/:repo/git/matching-refs/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitListMatchingRefsParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gitListMatchingRefs( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - }), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitGetRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - router.get( - "gitGetRef", - "/repos/:owner/:repo/git/ref/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitGetRefParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gitGetRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitCreateRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const gitCreateRefBodySchema = z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - key: z.coerce.string().optional(), - }) - - router.post( - "gitCreateRef", - "/repos/:owner/:repo/git/refs", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitCreateRefParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitCreateRefBodySchema, ctx.body), - } - - const { status, body } = await implementation.gitCreateRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitUpdateRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const gitUpdateRefBodySchema = z.object({ - sha: z.coerce.string(), - force: z.coerce.boolean().optional(), - }) - - router.patch( - "gitUpdateRef", - "/repos/:owner/:repo/git/refs/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitUpdateRefParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitUpdateRefBodySchema, ctx.body), - } - - const { status, body } = await implementation.gitUpdateRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitDeleteRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - router.delete( - "gitDeleteRef", - "/repos/:owner/:repo/git/refs/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitDeleteRefParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gitDeleteRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitCreateTagParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const gitCreateTagBodySchema = z.object({ - tag: z.coerce.string(), - message: z.coerce.string(), - object: z.coerce.string(), - type: z.enum(["commit", "tree", "blob"]), - tagger: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional(), - }) - - router.post( - "gitCreateTag", - "/repos/:owner/:repo/git/tags", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitCreateTagParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitCreateTagBodySchema, ctx.body), - } - - const { status, body } = await implementation.gitCreateTag(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - node_id: z.coerce.string(), - tag: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - message: z.coerce.string(), - tagger: z.object({ - date: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - }), - object: z.object({ - sha: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitGetTagParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - tag_sha: z.coerce.string(), - }) - - router.get( - "gitGetTag", - "/repos/:owner/:repo/git/tags/:tagSha", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitGetTagParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gitGetTag(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - node_id: z.coerce.string(), - tag: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - message: z.coerce.string(), - tagger: z.object({ - date: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - }), - object: z.object({ - sha: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitCreateTreeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const gitCreateTreeBodySchema = z.object({ - tree: z.array( - z.object({ - path: z.coerce.string().optional(), - mode: z - .enum(["100644", "100755", "040000", "160000", "120000"]) - .optional(), - type: z.enum(["blob", "tree", "commit"]).optional(), - sha: z.coerce.string().optional(), - content: z.coerce.string().optional(), - }) - ), - base_tree: z.coerce.string().optional(), - }) - - router.post( - "gitCreateTree", - "/repos/:owner/:repo/git/trees", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitCreateTreeParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(gitCreateTreeBodySchema, ctx.body), - } - - const { status, body } = await implementation.gitCreateTree(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - truncated: z.coerce.boolean(), - tree: z.array( - z.object({ - path: z.coerce.string().optional(), - mode: z.coerce.string().optional(), - type: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - }) - ), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const gitGetTreeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - tree_sha: z.coerce.string(), - }) - - const gitGetTreeQuerySchema = z.object({ - recursive: z.coerce.string().optional(), - }) - - router.get( - "gitGetTree", - "/repos/:owner/:repo/git/trees/:treeSha", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitGetTreeParamSchema, ctx.params), - query: parseRequestInput(gitGetTreeQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gitGetTree(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - truncated: z.coerce.boolean(), - tree: z.array( - z.object({ - path: z.coerce.string().optional(), - mode: z.coerce.string().optional(), - type: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - size: z.coerce.number().optional(), - url: z.coerce.string().optional(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListWebhooksParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListWebhooksQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListWebhooks", - "/repos/:owner/:repo/hooks", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListWebhooksParamSchema, ctx.params), - query: parseRequestInput(reposListWebhooksQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListWebhooks( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateWebhookParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateWebhookBodySchema = z - .object({ - name: z.coerce.string().optional(), - config: z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - token: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - active: z.coerce.boolean().optional(), - }) - .optional() - - router.post( - "reposCreateWebhook", - "/repos/:owner/:repo/hooks", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateWebhookParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateWebhookBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateWebhook( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetWebhookParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - router.get( - "reposGetWebhook", - "/repos/:owner/:repo/hooks/:hookId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetWebhookParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetWebhook(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateWebhookParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - const reposUpdateWebhookBodySchema = z.object({ - config: z - .object({ - url: z.coerce.string(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - address: z.coerce.string().optional(), - room: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), - add_events: z.array(z.coerce.string()).optional(), - remove_events: z.array(z.coerce.string()).optional(), - active: z.coerce.boolean().optional(), - }) - - router.patch( - "reposUpdateWebhook", - "/repos/:owner/:repo/hooks/:hookId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateWebhookParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateWebhookBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdateWebhook( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteWebhookParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteWebhook", - "/repos/:owner/:repo/hooks/:hookId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteWebhookParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteWebhook( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetWebhookConfigForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - router.get( - "reposGetWebhookConfigForRepo", - "/repos/:owner/:repo/hooks/:hookId/config", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetWebhookConfigForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposGetWebhookConfigForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateWebhookConfigForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - const reposUpdateWebhookConfigForRepoBodySchema = z - .object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }) - .optional() - - router.patch( - "reposUpdateWebhookConfigForRepo", - "/repos/:owner/:repo/hooks/:hookId/config", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateWebhookConfigForRepoParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reposUpdateWebhookConfigForRepoBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reposUpdateWebhookConfigForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListWebhookDeliveriesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - const reposListWebhookDeliveriesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - cursor: z.coerce.string().optional(), - redelivery: z.coerce.boolean().optional(), - }) - - router.get( - "reposListWebhookDeliveries", - "/repos/:owner/:repo/hooks/:hookId/deliveries", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListWebhookDeliveriesParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListWebhookDeliveriesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.reposListWebhookDeliveries( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetWebhookDeliveryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - delivery_id: z.coerce.number(), - }) - - router.get( - "reposGetWebhookDelivery", - "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposGetWebhookDeliveryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetWebhookDelivery( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - url: z.coerce.string().optional(), - request: z.object({ - headers: z.object({}), - payload: z.object({}), - }), - response: z.object({ - headers: z.object({}), - payload: z.coerce.string(), - }), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposRedeliverWebhookDeliveryParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - delivery_id: z.coerce.number(), - }) - - router.post( - "reposRedeliverWebhookDelivery", - "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId/attempts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposRedeliverWebhookDeliveryParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reposRedeliverWebhookDelivery(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposPingWebhookParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - router.post( - "reposPingWebhook", - "/repos/:owner/:repo/hooks/:hookId/pings", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposPingWebhookParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposPingWebhook(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposTestPushWebhookParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - hook_id: z.coerce.number(), - }) - - router.post( - "reposTestPushWebhook", - "/repos/:owner/:repo/hooks/:hookId/tests", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposTestPushWebhookParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposTestPushWebhook( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsGetImportStatusParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "migrationsGetImportStatus", - "/repos/:owner/:repo/import", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsGetImportStatusParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.migrationsGetImportStatus( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsStartImportParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const migrationsStartImportBodySchema = z.object({ - vcs_url: z.coerce.string(), - vcs: z.enum(["subversion", "git", "mercurial", "tfvc"]).optional(), - vcs_username: z.coerce.string().optional(), - vcs_password: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - }) - - router.put( - "migrationsStartImport", - "/repos/:owner/:repo/import", - async (ctx, next) => { - const input = { - params: parseRequestInput(migrationsStartImportParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(migrationsStartImportBodySchema, ctx.body), - } - - const { status, body } = await implementation.migrationsStartImport( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsUpdateImportParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const migrationsUpdateImportBodySchema = z - .object({ - vcs_username: z.coerce.string().optional(), - vcs_password: z.coerce.string().optional(), - vcs: z.enum(["subversion", "tfvc", "git", "mercurial"]).optional(), - tfvc_project: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "migrationsUpdateImport", - "/repos/:owner/:repo/import", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsUpdateImportParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(migrationsUpdateImportBodySchema, ctx.body), - } - - const { status, body } = await implementation.migrationsUpdateImport( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsCancelImportParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "migrationsCancelImport", - "/repos/:owner/:repo/import", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsCancelImportParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.migrationsCancelImport( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsGetCommitAuthorsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const migrationsGetCommitAuthorsQuerySchema = z.object({ - since: z.coerce.number().optional(), - }) - - router.get( - "migrationsGetCommitAuthors", - "/repos/:owner/:repo/import/authors", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsGetCommitAuthorsParamSchema, - ctx.params - ), - query: parseRequestInput( - migrationsGetCommitAuthorsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.migrationsGetCommitAuthors( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - remote_id: z.coerce.string(), - remote_name: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - import_url: z.coerce.string(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsMapCommitAuthorParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - author_id: z.coerce.number(), - }) - - const migrationsMapCommitAuthorBodySchema = z - .object({ - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "migrationsMapCommitAuthor", - "/repos/:owner/:repo/import/authors/:authorId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsMapCommitAuthorParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(migrationsMapCommitAuthorBodySchema, ctx.body), - } - - const { status, body } = await implementation.migrationsMapCommitAuthor( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - remote_id: z.coerce.string(), - remote_name: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - import_url: z.coerce.string(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsGetLargeFilesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "migrationsGetLargeFiles", - "/repos/:owner/:repo/import/large_files", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsGetLargeFilesParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.migrationsGetLargeFiles( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref_name: z.coerce.string(), - path: z.coerce.string(), - oid: z.coerce.string(), - size: z.coerce.number(), - }) - ), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsSetLfsPreferenceParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const migrationsSetLfsPreferenceBodySchema = z.object({ - use_lfs: z.enum(["opt_in", "opt_out"]), - }) - - router.patch( - "migrationsSetLfsPreference", - "/repos/:owner/:repo/import/lfs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsSetLfsPreferenceParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(migrationsSetLfsPreferenceBodySchema, ctx.body), - } - - const { status, body } = await implementation.migrationsSetLfsPreference( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - vcs: z.coerce.string(), - use_lfs: z.coerce.boolean().optional(), - vcs_url: z.coerce.string(), - svc_root: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - status: z.enum([ - "auth", - "error", - "none", - "detecting", - "choose", - "auth_failed", - "importing", - "mapping", - "waiting_to_push", - "pushing", - "complete", - "setup", - "unknown", - "detection_found_multiple", - "detection_found_nothing", - "detection_needs_auth", - ]), - status_text: z.coerce.string().optional(), - failed_step: z.coerce.string().optional(), - error_message: z.coerce.string().optional(), - import_percent: z.coerce.number().optional(), - commit_count: z.coerce.number().optional(), - push_percent: z.coerce.number().optional(), - has_large_files: z.coerce.boolean().optional(), - large_files_size: z.coerce.number().optional(), - large_files_count: z.coerce.number().optional(), - project_choices: z - .array( - z.object({ - vcs: z.coerce.string().optional(), - tfvc_project: z.coerce.string().optional(), - human_name: z.coerce.string().optional(), - }) - ) - .optional(), - message: z.coerce.string().optional(), - authors_count: z.coerce.number().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - authors_url: z.coerce.string(), - repository_url: z.coerce.string(), - svn_root: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsGetRepoInstallationParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "appsGetRepoInstallation", - "/repos/:owner/:repo/installation", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsGetRepoInstallationParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.appsGetRepoInstallation( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const interactionsGetRestrictionsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "interactionsGetRestrictionsForRepo", - "/repos/:owner/:repo/interaction-limits", - async (ctx, next) => { - const input = { - params: parseRequestInput( - interactionsGetRestrictionsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.interactionsGetRestrictionsForRepo(input, ctx) - - ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const interactionsSetRestrictionsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const interactionsSetRestrictionsForRepoBodySchema = z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - expiry: z - .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) - .optional(), - }) - - router.put( - "interactionsSetRestrictionsForRepo", - "/repos/:owner/:repo/interaction-limits", - async (ctx, next) => { - const input = { - params: parseRequestInput( - interactionsSetRestrictionsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - interactionsSetRestrictionsForRepoBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.interactionsSetRestrictionsForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - origin: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ["409", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const interactionsRemoveRestrictionsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "interactionsRemoveRestrictionsForRepo", - "/repos/:owner/:repo/interaction-limits", - async (ctx, next) => { - const input = { - params: parseRequestInput( - interactionsRemoveRestrictionsForRepoParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListInvitationsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListInvitationsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reposListInvitations", - "/repos/:owner/:repo/invitations", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListInvitationsParamSchema, ctx.params), - query: parseRequestInput(reposListInvitationsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListInvitations( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateInvitationParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - invitation_id: z.coerce.number(), - }) - - const reposUpdateInvitationBodySchema = z - .object({ - permissions: z - .enum(["read", "write", "maintain", "triage", "admin"]) - .optional(), - }) - .optional() - - router.patch( - "reposUpdateInvitation", - "/repos/:owner/:repo/invitations/:invitationId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateInvitationParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateInvitationBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdateInvitation( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteInvitationParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - invitation_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteInvitation", - "/repos/:owner/:repo/invitations/:invitationId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposDeleteInvitationParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteInvitation( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const issuesListForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesListForRepoQuerySchema = z.object({ - milestone: z.coerce.string().optional(), - state: z.enum(["open", "closed", "all"]).optional(), - assignee: z.coerce.string().optional(), - creator: z.coerce.string().optional(), - mentioned: z.coerce.string().optional(), - labels: z.coerce.string().optional(), - sort: z.enum(["created", "updated", "comments"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListForRepo", - "/repos/:owner/:repo/issues", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListForRepoParamSchema, ctx.params), - query: parseRequestInput(issuesListForRepoQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesCreateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesCreateBodySchema = z.object({ - title: z.union([z.coerce.string(), z.coerce.number()]), - body: z.coerce.string().optional(), - assignee: z.coerce.string().optional(), - milestone: z.union([z.coerce.string(), z.coerce.number()]), - labels: z - .array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - }), - ]) - ) - .optional(), - assignees: z.array(z.coerce.string()).optional(), - }) - - router.post( - "issuesCreate", - "/repos/:owner/:repo/issues", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesCreateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesCreateBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesCreate(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesListCommentsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesListCommentsForRepoQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListCommentsForRepo", - "/repos/:owner/:repo/issues/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - issuesListCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.issuesListCommentsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesGetCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - router.get( - "issuesGetComment", - "/repos/:owner/:repo/issues/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetCommentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGetComment(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesUpdateCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const issuesUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) - - router.patch( - "issuesUpdateComment", - "/repos/:owner/:repo/issues/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesUpdateCommentParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateCommentBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesUpdateComment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesDeleteCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - router.delete( - "issuesDeleteComment", - "/repos/:owner/:repo/issues/comments/:commentId", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesDeleteCommentParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesDeleteComment( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reactionsListForIssueCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsListForIssueCommentQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "reactionsListForIssueComment", - "/repos/:owner/:repo/issues/comments/:commentId/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsListForIssueCommentParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForIssueCommentQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reactionsListForIssueComment(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reactionsCreateForIssueCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - }) - - const reactionsCreateForIssueCommentBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) - - router.post( - "reactionsCreateForIssueComment", - "/repos/:owner/:repo/issues/comments/:commentId/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForIssueCommentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reactionsCreateForIssueCommentBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reactionsCreateForIssueComment(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reactionsDeleteForIssueCommentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - comment_id: z.coerce.number(), - reaction_id: z.coerce.number(), - }) - - router.delete( - "reactionsDeleteForIssueComment", - "/repos/:owner/:repo/issues/comments/:commentId/reactions/:reactionId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsDeleteForIssueCommentParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.reactionsDeleteForIssueComment(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const issuesListEventsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesListEventsForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "issuesListEventsForRepo", - "/repos/:owner/:repo/issues/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListEventsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput(issuesListEventsForRepoQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListEventsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - actor: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - event: z.coerce.string(), - commit_id: z.coerce.string(), - commit_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - label: z - .object({ name: z.coerce.string(), color: z.coerce.string() }) - .optional(), - assignee: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - assigner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - review_requester: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_reviewer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_team: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - .optional(), - dismissed_review: z - .object({ - state: z.coerce.string(), - review_id: z.coerce.number(), - dismissal_message: z.coerce.string(), - dismissal_commit_id: z.coerce.string().optional(), - }) - .optional(), - milestone: z.object({ title: z.coerce.string() }).optional(), - project_card: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - project_url: z.coerce.string(), - project_id: z.coerce.number(), - column_name: z.coerce.string(), - previous_column_name: z.coerce.string().optional(), - }) - .optional(), - rename: z - .object({ from: z.coerce.string(), to: z.coerce.string() }) - .optional(), - author_association: z - .enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]) - .optional(), - lock_reason: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesGetEventParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - event_id: z.coerce.number(), - }) - - router.get( - "issuesGetEvent", - "/repos/:owner/:repo/issues/events/:eventId", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetEventParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGetEvent(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - actor: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - event: z.coerce.string(), - commit_id: z.coerce.string(), - commit_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - label: z - .object({ name: z.coerce.string(), color: z.coerce.string() }) - .optional(), - assignee: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - assigner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - review_requester: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_reviewer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_team: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - .optional(), - dismissed_review: z - .object({ - state: z.coerce.string(), - review_id: z.coerce.number(), - dismissal_message: z.coerce.string(), - dismissal_commit_id: z.coerce.string().optional(), - }) - .optional(), - milestone: z.object({ title: z.coerce.string() }).optional(), - project_card: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - project_url: z.coerce.string(), - project_id: z.coerce.number(), - column_name: z.coerce.string(), - previous_column_name: z.coerce.string().optional(), - }) - .optional(), - rename: z - .object({ from: z.coerce.string(), to: z.coerce.string() }) - .optional(), - author_association: z - .enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]) - .optional(), - lock_reason: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesGetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - router.get( - "issuesGet", - "/repos/:owner/:repo/issues/:issueNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGet(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["304", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesUpdateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesUpdateBodySchema = z - .object({ - title: z.union([z.coerce.string(), z.coerce.number()]), - body: z.coerce.string().optional(), - assignee: z.coerce.string().optional(), - state: z.enum(["open", "closed"]).optional(), - state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), - milestone: z.union([z.coerce.string(), z.coerce.number()]), - labels: z - .array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - }), - ]) - ) - .optional(), - assignees: z.array(z.coerce.string()).optional(), - }) - .optional() - - router.patch( - "issuesUpdate", - "/repos/:owner/:repo/issues/:issueNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesUpdate(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + router.delete( + "reposDeleteAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDeleteAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposDeleteAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposGetAppsWithAccessToProtectedBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetAppsWithAccessToProtectedBranch", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetAppsWithAccessToProtectedBranchParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetAppsWithAccessToProtectedBranch(input, ctx) + + ctx.body = responseValidationFactory( + [ [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -81402,149 +39211,139 @@ export function bootstrap( } ) - const issuesAddAssigneesParamSchema = z.object({ + const reposAddAppAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + branch: z.coerce.string(), }) - const issuesAddAssigneesBodySchema = z - .object({ assignees: z.array(z.coerce.string()).optional() }) - .optional() + const reposAddAppAccessRestrictionsBodySchema = z.union([ + z.object({ apps: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) router.post( - "issuesAddAssignees", - "/repos/:owner/:repo/issues/:issueNumber/assignees", + "reposAddAppAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", async (ctx, next) => { const input = { - params: parseRequestInput(issuesAddAssigneesParamSchema, ctx.params), + params: parseRequestInput( + reposAddAppAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(issuesAddAssigneesBodySchema, ctx.body), + body: parseRequestInput( + reposAddAppAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.issuesAddAssignees( - input, - ctx - ) + const { status, body } = + await implementation.reposAddAppAccessRestrictions(input, ctx) ctx.body = responseValidationFactory( [ [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + "200", + z.array( + z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - labels_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposSetAppAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposSetAppAccessRestrictionsBodySchema = z.union([ + z.object({ apps: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.put( + "reposSetAppAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposSetAppAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposSetAppAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposSetAppAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -81567,436 +39366,281 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveAppAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveAppAccessRestrictionsBodySchema = z.union([ + z.object({ apps: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveAppAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveAppAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveAppAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposRemoveAppAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetTeamsWithAccessToProtectedBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetTeamsWithAccessToProtectedBranch", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetTeamsWithAccessToProtectedBranchParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetTeamsWithAccessToProtectedBranch( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposAddTeamAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposAddTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.post( + "reposAddTeamAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposAddTeamAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposAddTeamAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposAddTeamAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), description: z.coerce.string(), - external_url: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), ], + ["422", s_validation_error], ], undefined )(status, body) @@ -82005,601 +39649,470 @@ export function bootstrap( } ) - const issuesRemoveAssigneesParamSchema = z.object({ + const reposSetTeamAccessRestrictionsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + branch: z.coerce.string(), }) - const issuesRemoveAssigneesBodySchema = z.object({ - assignees: z.array(z.coerce.string()).optional(), - }) + const reposSetTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) - router.delete( - "issuesRemoveAssignees", - "/repos/:owner/:repo/issues/:issueNumber/assignees", + router.put( + "reposSetTeamAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", async (ctx, next) => { const input = { - params: parseRequestInput(issuesRemoveAssigneesParamSchema, ctx.params), + params: parseRequestInput( + reposSetTeamAccessRestrictionsParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(issuesRemoveAssigneesBodySchema, ctx.body), + body: parseRequestInput( + reposSetTeamAccessRestrictionsBodySchema, + ctx.body + ), } - const { status, body } = await implementation.issuesRemoveAssignees( - input, - ctx - ) + const { status, body } = + await implementation.reposSetTeamAccessRestrictions(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), description: z.coerce.string(), - external_url: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveTeamAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveTeamAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveTeamAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveTeamAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposRemoveTeamAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetUsersWithAccessToProtectedBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + router.get( + "reposGetUsersWithAccessToProtectedBranch", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetUsersWithAccessToProtectedBranchParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetUsersWithAccessToProtectedBranch( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposAddUserAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposAddUserAccessRestrictionsBodySchema = z.union([ + z.object({ users: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.post( + "reposAddUserAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposAddUserAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposAddUserAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposAddUserAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposSetUserAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposSetUserAccessRestrictionsBodySchema = z.union([ + z.object({ users: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.put( + "reposSetUserAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposSetUserAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposSetUserAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposSetUserAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRemoveUserAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRemoveUserAccessRestrictionsBodySchema = z.union([ + z.object({ users: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + router.delete( + "reposRemoveUserAccessRestrictions", + "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRemoveUserAccessRestrictionsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposRemoveUserAccessRestrictionsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposRemoveUserAccessRestrictions(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRenameBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposRenameBranchBodySchema = z.object({ new_name: z.coerce.string() }) + + router.post( + "reposRenameBranch", + "/repos/:owner/:repo/branches/:branch/rename", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposRenameBranchParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposRenameBranchBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposRenameBranch( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_branch_with_protection], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -82608,72 +40121,174 @@ export function bootstrap( } ) - const issuesCheckUserCanBeAssignedToIssueParamSchema = z.object({ + const checksCreateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const checksCreateBodySchema = z.union([ + z.object({ status: z.object({}) }), + z.object({ status: z.object({}).optional() }), + ]) + + router.post( + "checksCreate", + "/repos/:owner/:repo/check-runs", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksCreateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(checksCreateBodySchema, ctx.body), + } + + const { status, body } = await implementation.checksCreate(input, ctx) + + ctx.body = responseValidationFactory([["201", s_check_run]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const checksGetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + check_run_id: z.coerce.number(), + }) + + router.get( + "checksGet", + "/repos/:owner/:repo/check-runs/:checkRunId", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksGetParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.checksGet(input, ctx) + + ctx.body = responseValidationFactory([["200", s_check_run]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const checksUpdateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), - assignee: z.coerce.string(), + check_run_id: z.coerce.number(), }) - router.get( - "issuesCheckUserCanBeAssignedToIssue", - "/repos/:owner/:repo/issues/:issueNumber/assignees/:assignee", + const checksUpdateBodySchema = z.object({ + name: z.coerce.string().optional(), + details_url: z.coerce.string().optional(), + external_id: z.coerce.string().optional(), + started_at: z.coerce.string().datetime({ offset: true }).optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + conclusion: z + .enum([ + "action_required", + "cancelled", + "failure", + "neutral", + "success", + "skipped", + "stale", + "timed_out", + ]) + .optional(), + completed_at: z.coerce.string().datetime({ offset: true }).optional(), + output: z + .object({ + title: z.coerce.string().optional(), + summary: z.coerce.string(), + text: z.coerce.string().optional(), + annotations: z + .array( + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + annotation_level: z.enum(["notice", "warning", "failure"]), + message: z.coerce.string(), + title: z.coerce.string().optional(), + raw_details: z.coerce.string().optional(), + }) + ) + .optional(), + images: z + .array( + z.object({ + alt: z.coerce.string(), + image_url: z.coerce.string(), + caption: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + actions: z + .array( + z.object({ + label: z.coerce.string(), + description: z.coerce.string(), + identifier: z.coerce.string(), + }) + ) + .optional(), + }) + + router.patch( + "checksUpdate", + "/repos/:owner/:repo/check-runs/:checkRunId", async (ctx, next) => { const input = { - params: parseRequestInput( - issuesCheckUserCanBeAssignedToIssueParamSchema, - ctx.params - ), + params: parseRequestInput(checksUpdateParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(checksUpdateBodySchema, ctx.body), } - const { status, body } = - await implementation.issuesCheckUserCanBeAssignedToIssue(input, ctx) + const { status, body } = await implementation.checksUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_check_run]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const issuesListCommentsParamSchema = z.object({ + const checksListAnnotationsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + check_run_id: z.coerce.number(), }) - const issuesListCommentsQuerySchema = z.object({ - since: z.coerce.string().datetime({ offset: true }).optional(), + const checksListAnnotationsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "issuesListComments", - "/repos/:owner/:repo/issues/:issueNumber/comments", + "checksListAnnotations", + "/repos/:owner/:repo/check-runs/:checkRunId/annotations", async (ctx, next) => { const input = { - params: parseRequestInput(issuesListCommentsParamSchema, ctx.params), - query: parseRequestInput(issuesListCommentsQuerySchema, ctx.query), + params: parseRequestInput(checksListAnnotationsParamSchema, ctx.params), + query: parseRequestInput(checksListAnnotationsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.issuesListComments( + const { status, body } = await implementation.checksListAnnotations( input, ctx ) @@ -82684,133 +40299,19 @@ export function bootstrap( "200", z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + annotation_level: z.coerce.string(), + title: z.coerce.string(), + message: z.coerce.string(), + raw_details: z.coerce.string(), + blob_href: z.coerce.string(), }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], ], undefined )(status, body) @@ -82819,192 +40320,67 @@ export function bootstrap( } ) - const issuesCreateCommentParamSchema = z.object({ + const checksRerequestRunParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + check_run_id: z.coerce.number(), }) - const issuesCreateCommentBodySchema = z.object({ body: z.coerce.string() }) + router.post( + "checksRerequestRun", + "/repos/:owner/:repo/check-runs/:checkRunId/rerequest", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksRerequestRunParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.checksRerequestRun( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksCreateSuiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const checksCreateSuiteBodySchema = z.object({ head_sha: z.coerce.string() }) router.post( - "issuesCreateComment", - "/repos/:owner/:repo/issues/:issueNumber/comments", + "checksCreateSuite", + "/repos/:owner/:repo/check-suites", async (ctx, next) => { const input = { - params: parseRequestInput(issuesCreateCommentParamSchema, ctx.params), + params: parseRequestInput(checksCreateSuiteParamSchema, ctx.params), query: undefined, - body: parseRequestInput(issuesCreateCommentBodySchema, ctx.body), + body: parseRequestInput(checksCreateSuiteBodySchema, ctx.body), } - const { status, body } = await implementation.issuesCreateComment( + const { status, body } = await implementation.checksCreateSuite( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_check_suite], + ["201", s_check_suite], ], undefined )(status, body) @@ -83013,74 +40389,98 @@ export function bootstrap( } ) - const issuesListEventsParamSchema = z.object({ + const checksSetSuitesPreferencesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), }) - const issuesListEventsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const checksSetSuitesPreferencesBodySchema = z.object({ + auto_trigger_checks: z + .array( + z.object({ app_id: z.coerce.number(), setting: z.coerce.boolean() }) + ) + .optional(), + }) + + router.patch( + "checksSetSuitesPreferences", + "/repos/:owner/:repo/check-suites/preferences", + async (ctx, next) => { + const input = { + params: parseRequestInput( + checksSetSuitesPreferencesParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(checksSetSuitesPreferencesBodySchema, ctx.body), + } + + const { status, body } = await implementation.checksSetSuitesPreferences( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_check_suite_preference]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksGetSuiteParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + check_suite_id: z.coerce.number(), }) router.get( - "issuesListEvents", - "/repos/:owner/:repo/issues/:issueNumber/events", + "checksGetSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId", async (ctx, next) => { const input = { - params: parseRequestInput(issuesListEventsParamSchema, ctx.params), - query: parseRequestInput(issuesListEventsQuerySchema, ctx.query), + params: parseRequestInput(checksGetSuiteParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.issuesListEvents(input, ctx) + const { status, body } = await implementation.checksGetSuite(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.object({}))], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_check_suite]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const issuesListLabelsOnIssueParamSchema = z.object({ + const checksListForSuiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + check_suite_id: z.coerce.number(), }) - const issuesListLabelsOnIssueQuerySchema = z.object({ + const checksListForSuiteQuerySchema = z.object({ + check_name: z.coerce.string().optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + filter: z.enum(["latest", "all"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "issuesListLabelsOnIssue", - "/repos/:owner/:repo/issues/:issueNumber/labels", + "checksListForSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId/check-runs", async (ctx, next) => { const input = { - params: parseRequestInput( - issuesListLabelsOnIssueParamSchema, - ctx.params - ), - query: parseRequestInput(issuesListLabelsOnIssueQuerySchema, ctx.query), + params: parseRequestInput(checksListForSuiteParamSchema, ctx.params), + query: parseRequestInput(checksListForSuiteQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.issuesListLabelsOnIssue( + const { status, body } = await implementation.checksListForSuite( input, ctx ) @@ -83089,43 +40489,182 @@ export function bootstrap( [ [ "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), }), ], ], @@ -83136,101 +40675,29 @@ export function bootstrap( } ) - const issuesAddLabelsParamSchema = z.object({ + const checksRerequestSuiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + check_suite_id: z.coerce.number(), }) - const issuesAddLabelsBodySchema = z.union([ - z.object({ labels: z.array(z.coerce.string()).optional() }), - z.array(z.coerce.string()), - z.object({ - labels: z.array(z.object({ name: z.coerce.string() })).optional(), - }), - z.array(z.object({ name: z.coerce.string() })), - z.coerce.string(), - ]) - router.post( - "issuesAddLabels", - "/repos/:owner/:repo/issues/:issueNumber/labels", + "checksRerequestSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId/rerequest", async (ctx, next) => { const input = { - params: parseRequestInput(issuesAddLabelsParamSchema, ctx.params), + params: parseRequestInput(checksRerequestSuiteParamSchema, ctx.params), query: undefined, - body: parseRequestInput(issuesAddLabelsBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.issuesAddLabels(input, ctx) + const { status, body } = await implementation.checksRerequestSuite( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], + [["201", s_empty_object]], undefined )(status, body) ctx.status = status @@ -83238,33 +40705,43 @@ export function bootstrap( } ) - const issuesSetLabelsParamSchema = z.object({ + const codeScanningListAlertsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), }) - const issuesSetLabelsBodySchema = z.union([ - z.object({ labels: z.array(z.coerce.string()).optional() }), - z.array(z.coerce.string()), - z.object({ - labels: z.array(z.object({ name: z.coerce.string() })).optional(), - }), - z.array(z.object({ name: z.coerce.string() })), - z.coerce.string(), - ]) + const codeScanningListAlertsForRepoQuerySchema = z.object({ + tool_name: z.coerce.string().optional(), + tool_guid: z.coerce.string().optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + direction: z.enum(["asc", "desc"]).optional(), + sort: z.enum(["created", "updated"]).optional(), + state: z.enum(["open", "closed", "dismissed", "fixed"]).optional(), + severity: z + .enum(["critical", "high", "medium", "low", "warning", "note", "error"]) + .optional(), + }) - router.put( - "issuesSetLabels", - "/repos/:owner/:repo/issues/:issueNumber/labels", + router.get( + "codeScanningListAlertsForRepo", + "/repos/:owner/:repo/code-scanning/alerts", async (ctx, next) => { const input = { - params: parseRequestInput(issuesSetLabelsParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesSetLabelsBodySchema, ctx.body), + params: parseRequestInput( + codeScanningListAlertsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + codeScanningListAlertsForRepoQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.issuesSetLabels(input, ctx) + const { status, body } = + await implementation.codeScanningListAlertsForRepo(input, ctx) ctx.body = responseValidationFactory( [ @@ -83272,123 +40749,103 @@ export function bootstrap( "200", z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesRemoveAllLabelsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - router.delete( - "issuesRemoveAllLabels", - "/repos/:owner/:repo/issues/:issueNumber/labels", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesRemoveAllLabelsParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesRemoveAllLabels( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + description: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }) + ), ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], [ - "410", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -83399,69 +40856,39 @@ export function bootstrap( } ) - const issuesRemoveLabelParamSchema = z.object({ + const codeScanningGetAlertParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), - name: z.coerce.string(), + alert_number: z.coerce.number(), }) - router.delete( - "issuesRemoveLabel", - "/repos/:owner/:repo/issues/:issueNumber/labels/:name", + router.get( + "codeScanningGetAlert", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", async (ctx, next) => { const input = { - params: parseRequestInput(issuesRemoveLabelParamSchema, ctx.params), + params: parseRequestInput(codeScanningGetAlertParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.issuesRemoveLabel( + const { status, body } = await implementation.codeScanningGetAlert( input, ctx ) ctx.body = responseValidationFactory( [ + ["200", s_code_scanning_alert], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - [ - "301", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -83472,83 +40899,49 @@ export function bootstrap( } ) - const issuesLockParamSchema = z.object({ + const codeScanningUpdateAlertParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + alert_number: z.coerce.number(), }) - const issuesLockBodySchema = z - .object({ - lock_reason: z - .enum(["off-topic", "too heated", "resolved", "spam"]) - .optional(), - }) - .optional() + const codeScanningUpdateAlertBodySchema = z.object({ + state: z.enum(["open", "dismissed"]), + dismissed_reason: z + .enum(["null", "false positive", "won't fix", "used in tests"]) + .optional(), + dismissed_comment: z.coerce.string().optional(), + }) - router.put( - "issuesLock", - "/repos/:owner/:repo/issues/:issueNumber/lock", + router.patch( + "codeScanningUpdateAlert", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", async (ctx, next) => { const input = { - params: parseRequestInput(issuesLockParamSchema, ctx.params), + params: parseRequestInput( + codeScanningUpdateAlertParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(issuesLockBodySchema, ctx.body), + body: parseRequestInput(codeScanningUpdateAlertBodySchema, ctx.body), } - const { status, body } = await implementation.issuesLock(input, ctx) + const { status, body } = await implementation.codeScanningUpdateAlert( + input, + ctx + ) ctx.body = responseValidationFactory( [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_code_scanning_alert], + ["403", s_basic_error], + ["404", s_basic_error], [ - "410", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), }), ], ], @@ -83559,43 +40952,78 @@ export function bootstrap( } ) - const issuesUnlockParamSchema = z.object({ + const codeScanningListAlertInstancesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), + alert_number: z.coerce.number(), }) - router.delete( - "issuesUnlock", - "/repos/:owner/:repo/issues/:issueNumber/lock", + const codeScanningListAlertInstancesQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + }) + + router.get( + "codeScanningListAlertInstances", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber/instances", async (ctx, next) => { const input = { - params: parseRequestInput(issuesUnlockParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + codeScanningListAlertInstancesParamSchema, + ctx.params + ), + query: parseRequestInput( + codeScanningListAlertInstancesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.issuesUnlock(input, ctx) + const { status, body } = + await implementation.codeScanningListAlertInstances(input, ctx) ctx.body = responseValidationFactory( [ - ["204", z.void()], [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }) + ), ], + ["403", s_basic_error], + ["404", s_basic_error], [ - "404", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -83606,43 +41034,40 @@ export function bootstrap( } ) - const reactionsListForIssueParamSchema = z.object({ + const codeScanningListRecentAnalysesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), }) - const reactionsListForIssueQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), + const codeScanningListRecentAnalysesQuerySchema = z.object({ + tool_name: z.coerce.string().optional(), + tool_guid: z.coerce.string().optional(), page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + sarif_id: z.coerce.string().optional(), + direction: z.enum(["asc", "desc"]).optional(), + sort: z.enum(["created"]).optional(), }) router.get( - "reactionsListForIssue", - "/repos/:owner/:repo/issues/:issueNumber/reactions", + "codeScanningListRecentAnalyses", + "/repos/:owner/:repo/code-scanning/analyses", async (ctx, next) => { const input = { - params: parseRequestInput(reactionsListForIssueParamSchema, ctx.params), - query: parseRequestInput(reactionsListForIssueQuerySchema, ctx.query), + params: parseRequestInput( + codeScanningListRecentAnalysesParamSchema, + ctx.params + ), + query: parseRequestInput( + codeScanningListRecentAnalysesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reactionsListForIssue( - input, - ctx - ) + const { status, body } = + await implementation.codeScanningListRecentAnalyses(input, ctx) ctx.body = responseValidationFactory( [ @@ -83650,61 +41075,36 @@ export function bootstrap( "200", z.array( z.object({ + ref: z.coerce.string(), + commit_sha: z.coerce.string(), + analysis_key: z.coerce.string(), + environment: z.coerce.string(), + category: z.coerce.string().optional(), + error: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + results_count: z.coerce.number(), + rules_count: z.coerce.number(), id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ + url: z.coerce.string(), + sarif_id: z.coerce.string(), + tool: z.object({ name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), + deletable: z.coerce.boolean(), + warning: z.coerce.string(), }) ), ], + ["403", s_basic_error], + ["404", s_basic_error], [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -83715,148 +41115,41 @@ export function bootstrap( } ) - const reactionsCreateForIssueParamSchema = z.object({ + const codeScanningGetAnalysisParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const reactionsCreateForIssueBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), + analysis_id: z.coerce.number(), }) - router.post( - "reactionsCreateForIssue", - "/repos/:owner/:repo/issues/:issueNumber/reactions", + router.get( + "codeScanningGetAnalysis", + "/repos/:owner/:repo/code-scanning/analyses/:analysisId", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsCreateForIssueParamSchema, + codeScanningGetAnalysisParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(reactionsCreateForIssueBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reactionsCreateForIssue( + const { status, body } = await implementation.codeScanningGetAnalysis( input, ctx ) ctx.body = responseValidationFactory( [ + ["200", z.object({})], + ["403", s_basic_error], + ["404", s_basic_error], [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", + "503", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), }), ], ], @@ -83867,91 +41160,128 @@ export function bootstrap( } ) - const reactionsDeleteForIssueParamSchema = z.object({ + const codeScanningDeleteAnalysisParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), - reaction_id: z.coerce.number(), + analysis_id: z.coerce.number(), + }) + + const codeScanningDeleteAnalysisQuerySchema = z.object({ + confirm_delete: z.coerce.string().optional(), }) router.delete( - "reactionsDeleteForIssue", - "/repos/:owner/:repo/issues/:issueNumber/reactions/:reactionId", + "codeScanningDeleteAnalysis", + "/repos/:owner/:repo/code-scanning/analyses/:analysisId", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsDeleteForIssueParamSchema, + codeScanningDeleteAnalysisParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + codeScanningDeleteAnalysisQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reactionsDeleteForIssue( + const { status, body } = await implementation.codeScanningDeleteAnalysis( input, ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["200", s_code_scanning_analysis_deletion], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesListEventsForTimelineParamSchema = z.object({ + const codeScanningListCodeqlDatabasesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesListEventsForTimelineQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), }) router.get( - "issuesListEventsForTimeline", - "/repos/:owner/:repo/issues/:issueNumber/timeline", + "codeScanningListCodeqlDatabases", + "/repos/:owner/:repo/code-scanning/codeql/databases", async (ctx, next) => { const input = { params: parseRequestInput( - issuesListEventsForTimelineParamSchema, + codeScanningListCodeqlDatabasesParamSchema, ctx.params ), - query: parseRequestInput( - issuesListEventsForTimelineQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = await implementation.issuesListEventsForTimeline( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.object({}))], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + const { status, body } = + await implementation.codeScanningListCodeqlDatabases(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + language: z.coerce.string(), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + }) + ), ], + ["403", s_basic_error], + ["404", s_basic_error], [ - "410", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -83962,48 +41292,41 @@ export function bootstrap( } ) - const reposListDeployKeysParamSchema = z.object({ + const codeScanningGetCodeqlDatabaseParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - }) - - const reposListDeployKeysQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + language: z.coerce.string(), }) router.get( - "reposListDeployKeys", - "/repos/:owner/:repo/keys", + "codeScanningGetCodeqlDatabase", + "/repos/:owner/:repo/code-scanning/codeql/databases/:language", async (ctx, next) => { const input = { - params: parseRequestInput(reposListDeployKeysParamSchema, ctx.params), - query: parseRequestInput(reposListDeployKeysQuerySchema, ctx.query), + params: parseRequestInput( + codeScanningGetCodeqlDatabaseParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListDeployKeys( - input, - ctx - ) + const { status, body } = + await implementation.codeScanningGetCodeqlDatabase(input, ctx) ctx.body = responseValidationFactory( [ + ["200", s_code_scanning_codeql_database], + ["302", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - key: z.coerce.string(), - url: z.coerce.string(), - title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }) - ), + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), ], ], undefined @@ -84013,69 +41336,52 @@ export function bootstrap( } ) - const reposCreateDeployKeyParamSchema = z.object({ + const codeScanningUploadSarifParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposCreateDeployKeyBodySchema = z.object({ - title: z.coerce.string().optional(), - key: z.coerce.string(), - read_only: z.coerce.boolean().optional(), + const codeScanningUploadSarifBodySchema = z.object({ + commit_sha: z.coerce.string(), + ref: z.coerce.string(), + sarif: z.coerce.string(), + checkout_uri: z.coerce.string().optional(), + started_at: z.coerce.string().datetime({ offset: true }).optional(), + tool_name: z.coerce.string().optional(), + validate: z.coerce.boolean().optional(), }) router.post( - "reposCreateDeployKey", - "/repos/:owner/:repo/keys", + "codeScanningUploadSarif", + "/repos/:owner/:repo/code-scanning/sarifs", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreateDeployKeyParamSchema, ctx.params), + params: parseRequestInput( + codeScanningUploadSarifParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(reposCreateDeployKeyBodySchema, ctx.body), + body: parseRequestInput(codeScanningUploadSarifBodySchema, ctx.body), } - const { status, body } = await implementation.reposCreateDeployKey( + const { status, body } = await implementation.codeScanningUploadSarif( input, ctx ) ctx.body = responseValidationFactory( [ + ["202", s_code_scanning_sarifs_receipt], + ["400", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["413", z.void()], [ - "201", - z.object({ - id: z.coerce.number(), - key: z.coerce.string(), - url: z.coerce.string(), - title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }), - ], - [ - "422", + "503", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), }), ], ], @@ -84086,50 +41392,38 @@ export function bootstrap( } ) - const reposGetDeployKeyParamSchema = z.object({ + const codeScanningGetSarifParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - key_id: z.coerce.number(), + sarif_id: z.coerce.string(), }) router.get( - "reposGetDeployKey", - "/repos/:owner/:repo/keys/:keyId", + "codeScanningGetSarif", + "/repos/:owner/:repo/code-scanning/sarifs/:sarifId", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetDeployKeyParamSchema, ctx.params), + params: parseRequestInput(codeScanningGetSarifParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetDeployKey( + const { status, body } = await implementation.codeScanningGetSarif( input, ctx ) ctx.body = responseValidationFactory( [ + ["200", s_code_scanning_sarifs_status], + ["403", s_basic_error], + ["404", z.void()], [ - "200", - z.object({ - id: z.coerce.number(), - key: z.coerce.string(), - url: z.coerce.string(), - title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }), - ], - [ - "404", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -84140,89 +41434,379 @@ export function bootstrap( } ) - const reposDeleteDeployKeyParamSchema = z.object({ + const reposCodeownersErrorsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - key_id: z.coerce.number(), }) - router.delete( - "reposDeleteDeployKey", - "/repos/:owner/:repo/keys/:keyId", + const reposCodeownersErrorsQuerySchema = z.object({ + ref: z.coerce.string().optional(), + }) + + router.get( + "reposCodeownersErrors", + "/repos/:owner/:repo/codeowners/errors", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeleteDeployKeyParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(reposCodeownersErrorsParamSchema, ctx.params), + query: parseRequestInput(reposCodeownersErrorsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposDeleteDeployKey( + const { status, body } = await implementation.reposCodeownersErrors( input, ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["200", s_codeowners_errors], + ["404", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const issuesListLabelsForRepoParamSchema = z.object({ + const codespacesListInRepositoryForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const issuesListLabelsForRepoQuerySchema = z.object({ + const codespacesListInRepositoryForAuthenticatedUserQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "issuesListLabelsForRepo", - "/repos/:owner/:repo/labels", + "codespacesListInRepositoryForAuthenticatedUser", + "/repos/:owner/:repo/codespaces", async (ctx, next) => { const input = { params: parseRequestInput( - issuesListLabelsForRepoParamSchema, + codespacesListInRepositoryForAuthenticatedUserParamSchema, ctx.params ), - query: parseRequestInput(issuesListLabelsForRepoQuerySchema, ctx.query), + query: parseRequestInput( + codespacesListInRepositoryForAuthenticatedUserQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.issuesListLabelsForRepo( - input, - ctx - ) + const { status, body } = + await implementation.codespacesListInRepositoryForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - [ - "404", z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce + .string() + .optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), }), ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -84231,125 +41815,60 @@ export function bootstrap( } ) - const issuesCreateLabelParamSchema = z.object({ + const codespacesCreateWithRepoForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const issuesCreateLabelBodySchema = z.object({ - name: z.coerce.string(), - color: z.coerce.string().optional(), - description: z.coerce.string().optional(), + const codespacesCreateWithRepoForAuthenticatedUserBodySchema = z.object({ + ref: z.coerce.string().optional(), + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + multi_repo_permissions_opt_out: z.coerce.boolean().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + display_name: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), }) router.post( - "issuesCreateLabel", - "/repos/:owner/:repo/labels", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesCreateLabelParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesCreateLabelBodySchema, ctx.body), - } - - const { status, body } = await implementation.issuesCreateLabel( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesGetLabelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) - - router.get( - "issuesGetLabel", - "/repos/:owner/:repo/labels/:name", + "codespacesCreateWithRepoForAuthenticatedUser", + "/repos/:owner/:repo/codespaces", async (ctx, next) => { const input = { - params: parseRequestInput(issuesGetLabelParamSchema, ctx.params), + params: parseRequestInput( + codespacesCreateWithRepoForAuthenticatedUserParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + codespacesCreateWithRepoForAuthenticatedUserBodySchema, + ctx.body + ), } - const { status, body } = await implementation.issuesGetLabel(input, ctx) + const { status, body } = + await implementation.codespacesCreateWithRepoForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ + ["201", s_codespace], + ["202", s_codespace], + ["400", s_scim_error], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }), - ], - [ - "404", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -84360,49 +41879,56 @@ export function bootstrap( } ) - const issuesUpdateLabelParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - name: z.coerce.string(), - }) + const codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema = + z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) - const issuesUpdateLabelBodySchema = z - .object({ - new_name: z.coerce.string().optional(), - color: z.coerce.string().optional(), - description: z.coerce.string().optional(), + const codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema = + z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - .optional() - router.patch( - "issuesUpdateLabel", - "/repos/:owner/:repo/labels/:name", + router.get( + "codespacesListDevcontainersInRepositoryForAuthenticatedUser", + "/repos/:owner/:repo/codespaces/devcontainers", async (ctx, next) => { const input = { - params: parseRequestInput(issuesUpdateLabelParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesUpdateLabelBodySchema, ctx.body), + params: parseRequestInput( + codespacesListDevcontainersInRepositoryForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesListDevcontainersInRepositoryForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.issuesUpdateLabel( - input, - ctx - ) + const { status, body } = + await implementation.codespacesListDevcontainersInRepositoryForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), + total_count: z.coerce.number(), + devcontainers: z.array( + z.object({ + path: z.coerce.string(), + name: z.coerce.string().optional(), + }) + ), }), ], + ["400", s_scim_error], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -84411,460 +41937,113 @@ export function bootstrap( } ) - const issuesDeleteLabelParamSchema = z.object({ + const codespacesRepoMachinesForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - name: z.coerce.string(), }) - router.delete( - "issuesDeleteLabel", - "/repos/:owner/:repo/labels/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesDeleteLabelParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesDeleteLabel( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposListLanguagesParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), + const codespacesRepoMachinesForAuthenticatedUserQuerySchema = z.object({ + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), }) router.get( - "reposListLanguages", - "/repos/:owner/:repo/languages", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListLanguagesParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposListLanguages( - input, - ctx - ) - - ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const reposEnableLfsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.put( - "reposEnableLfsForRepo", - "/repos/:owner/:repo/lfs", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposEnableLfsForRepoParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposEnableLfsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["403", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDisableLfsForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.delete( - "reposDisableLfsForRepo", - "/repos/:owner/:repo/lfs", + "codespacesRepoMachinesForAuthenticatedUser", + "/repos/:owner/:repo/codespaces/machines", async (ctx, next) => { const input = { params: parseRequestInput( - reposDisableLfsForRepoParamSchema, + codespacesRepoMachinesForAuthenticatedUserParamSchema, ctx.params ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDisableLfsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const licensesGetForRepoParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - router.get( - "licensesGetForRepo", - "/repos/:owner/:repo/license", - async (ctx, next) => { - const input = { - params: parseRequestInput(licensesGetForRepoParamSchema, ctx.params), - query: undefined, + query: parseRequestInput( + codespacesRepoMachinesForAuthenticatedUserQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.licensesGetForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - size: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - git_url: z.coerce.string(), - download_url: z.coerce.string(), - type: z.coerce.string(), - content: z.coerce.string(), - encoding: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposMergeUpstreamParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposMergeUpstreamBodySchema = z.object({ branch: z.coerce.string() }) - - router.post( - "reposMergeUpstream", - "/repos/:owner/:repo/merge-upstream", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposMergeUpstreamParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposMergeUpstreamBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposMergeUpstream( - input, - ctx - ) + const { status, body } = + await implementation.codespacesRepoMachinesForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - message: z.coerce.string().optional(), - merge_type: z.enum(["merge", "fast-forward", "none"]).optional(), - base_branch: z.coerce.string().optional(), - }), - ], - ["409", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposMergeParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposMergeBodySchema = z.object({ - base: z.coerce.string(), - head: z.coerce.string(), - commit_message: z.coerce.string().optional(), - }) - - router.post("reposMerge", "/repos/:owner/:repo/merges", async (ctx, next) => { - const input = { - params: parseRequestInput(reposMergeParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposMergeBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposMerge(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }), - ], - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["404", z.void()], - ["409", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + [ + "200", + z.object({ + total_count: z.coerce.number(), + machines: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", ]), }) - ) - .optional(), - }), + ), + }), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const issuesListMilestonesParamSchema = z.object({ + const codespacesPreFlightWithRepoForAuthenticatedUserParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const issuesListMilestonesQuerySchema = z.object({ - state: z.enum(["open", "closed", "all"]).optional(), - sort: z.enum(["due_on", "completeness"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema = z.object({ + ref: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), }) router.get( - "issuesListMilestones", - "/repos/:owner/:repo/milestones", + "codespacesPreFlightWithRepoForAuthenticatedUser", + "/repos/:owner/:repo/codespaces/new", async (ctx, next) => { const input = { - params: parseRequestInput(issuesListMilestonesParamSchema, ctx.params), - query: parseRequestInput(issuesListMilestonesQuerySchema, ctx.query), + params: parseRequestInput( + codespacesPreFlightWithRepoForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesPreFlightWithRepoForAuthenticatedUserQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.issuesListMilestones( - input, - ctx - ) + const { status, body } = + await implementation.codespacesPreFlightWithRepoForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", - z.array( - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + z.object({ + billable_owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -84886,25 +42065,19 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), + }) + .optional(), + defaults: z + .object({ + location: z.coerce.string(), + devcontainer_path: z.coerce.string(), + }) + .optional(), }), ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -84913,29 +42086,33 @@ export function bootstrap( } ) - const issuesCreateMilestoneParamSchema = z.object({ + const codespacesListRepoSecretsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const issuesCreateMilestoneBodySchema = z.object({ - title: z.coerce.string(), - state: z.enum(["open", "closed"]).optional(), - description: z.coerce.string().optional(), - due_on: z.coerce.string().datetime({ offset: true }).optional(), + const codespacesListRepoSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "issuesCreateMilestone", - "/repos/:owner/:repo/milestones", + router.get( + "codespacesListRepoSecrets", + "/repos/:owner/:repo/codespaces/secrets", async (ctx, next) => { const input = { - params: parseRequestInput(issuesCreateMilestoneParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(issuesCreateMilestoneBodySchema, ctx.body), + params: parseRequestInput( + codespacesListRepoSecretsParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesListRepoSecretsQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.issuesCreateMilestone( + const { status, body } = await implementation.codespacesListRepoSecrets( input, ctx ) @@ -84943,78 +42120,16 @@ export function bootstrap( ctx.body = responseValidationFactory( [ [ - "201", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", + "200", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), }), ], ], @@ -85025,81 +42140,105 @@ export function bootstrap( } ) - const issuesGetMilestoneParamSchema = z.object({ + const codespacesGetRepoPublicKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - milestone_number: z.coerce.number(), }) router.get( - "issuesGetMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber", + "codespacesGetRepoPublicKey", + "/repos/:owner/:repo/codespaces/secrets/public-key", async (ctx, next) => { const input = { - params: parseRequestInput(issuesGetMilestoneParamSchema, ctx.params), + params: parseRequestInput( + codespacesGetRepoPublicKeyParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.issuesGetMilestone( + const { status, body } = await implementation.codespacesGetRepoPublicKey( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_codespaces_public_key]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesGetRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.get( + "codespacesGetRepoSecret", + "/repos/:owner/:repo/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.codespacesGetRepoSecret( input, ctx ) + ctx.body = responseValidationFactory( + [["200", s_repo_codespaces_secret]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateOrUpdateRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const codespacesCreateOrUpdateRepoSecretBodySchema = z.object({ + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string().optional(), + }) + + router.put( + "codespacesCreateOrUpdateRepoSecret", + "/repos/:owner/:repo/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCreateOrUpdateRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesCreateOrUpdateRepoSecretBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateOrUpdateRepoSecret(input, ctx) + ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["201", s_empty_object], + ["204", z.void()], ], undefined )(status, body) @@ -85108,32 +42247,67 @@ export function bootstrap( } ) - const issuesUpdateMilestoneParamSchema = z.object({ + const codespacesDeleteRepoSecretParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - milestone_number: z.coerce.number(), + secret_name: z.coerce.string(), }) - const issuesUpdateMilestoneBodySchema = z - .object({ - title: z.coerce.string().optional(), - state: z.enum(["open", "closed"]).optional(), - description: z.coerce.string().optional(), - due_on: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional() - - router.patch( - "issuesUpdateMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber", + router.delete( + "codespacesDeleteRepoSecret", + "/repos/:owner/:repo/codespaces/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput(issuesUpdateMilestoneParamSchema, ctx.params), + params: parseRequestInput( + codespacesDeleteRepoSecretParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(issuesUpdateMilestoneBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.issuesUpdateMilestone( + const { status, body } = await implementation.codespacesDeleteRepoSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListCollaboratorsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListCollaboratorsQuerySchema = z.object({ + affiliation: z.enum(["outside", "direct", "all"]).optional(), + permission: z + .enum(["pull", "triage", "push", "maintain", "admin"]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListCollaborators", + "/repos/:owner/:repo/collaborators", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCollaboratorsParamSchema, + ctx.params + ), + query: parseRequestInput(reposListCollaboratorsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListCollaborators( input, ctx ) @@ -85142,21 +42316,12 @@ export function bootstrap( [ [ "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), + z.array( + z.object({ login: z.coerce.string(), id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), node_id: z.coerce.string(), avatar_url: z.coerce.string(), gravatar_id: z.coerce.string(), @@ -85173,16 +42338,20 @@ export function bootstrap( received_events_url: z.coerce.string(), type: z.coerce.string(), site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + }) + .optional(), + role_name: z.coerce.string(), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -85191,23 +42360,26 @@ export function bootstrap( } ) - const issuesDeleteMilestoneParamSchema = z.object({ + const reposCheckCollaboratorParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - milestone_number: z.coerce.number(), + username: z.coerce.string(), }) - router.delete( - "issuesDeleteMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber", + router.get( + "reposCheckCollaborator", + "/repos/:owner/:repo/collaborators/:username", async (ctx, next) => { const input = { - params: parseRequestInput(issuesDeleteMilestoneParamSchema, ctx.params), + params: parseRequestInput( + reposCheckCollaboratorParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.issuesDeleteMilestone( + const { status, body } = await implementation.reposCheckCollaborator( input, ctx ) @@ -85215,15 +42387,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", z.void()], ], undefined )(status, body) @@ -85232,52 +42396,37 @@ export function bootstrap( } ) - const issuesListLabelsForMilestoneParamSchema = z.object({ + const reposAddCollaboratorParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - milestone_number: z.coerce.number(), + username: z.coerce.string(), }) - const issuesListLabelsForMilestoneQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const reposAddCollaboratorBodySchema = z + .object({ permission: z.coerce.string().optional() }) + .optional() - router.get( - "issuesListLabelsForMilestone", - "/repos/:owner/:repo/milestones/:milestoneNumber/labels", + router.put( + "reposAddCollaborator", + "/repos/:owner/:repo/collaborators/:username", async (ctx, next) => { const input = { - params: parseRequestInput( - issuesListLabelsForMilestoneParamSchema, - ctx.params - ), - query: parseRequestInput( - issuesListLabelsForMilestoneQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.issuesListLabelsForMilestone(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], + params: parseRequestInput(reposAddCollaboratorParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposAddCollaboratorBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposAddCollaborator( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_repository_invitation], + ["204", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -85286,275 +42435,65 @@ export function bootstrap( } ) - const activityListRepoNotificationsForAuthenticatedUserParamSchema = z.object( - { owner: z.coerce.string(), repo: z.coerce.string() } - ) - - const activityListRepoNotificationsForAuthenticatedUserQuerySchema = z.object( - { - all: z.coerce.boolean().optional(), - participating: z.coerce.boolean().optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - before: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - } - ) + const reposRemoveCollaboratorParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + username: z.coerce.string(), + }) - router.get( - "activityListRepoNotificationsForAuthenticatedUser", - "/repos/:owner/:repo/notifications", + router.delete( + "reposRemoveCollaborator", + "/repos/:owner/:repo/collaborators/:username", async (ctx, next) => { const input = { params: parseRequestInput( - activityListRepoNotificationsForAuthenticatedUserParamSchema, + reposRemoveCollaboratorParamSchema, ctx.params ), - query: parseRequestInput( - activityListRepoNotificationsForAuthenticatedUserQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = - await implementation.activityListRepoNotificationsForAuthenticatedUser( - input, - ctx - ) + const { status, body } = await implementation.reposRemoveCollaborator( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - subject: z.object({ - title: z.coerce.string(), - url: z.coerce.string(), - latest_comment_url: z.coerce.string(), - type: z.coerce.string(), - }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), - url: z.coerce.string(), - subscription_url: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const activityMarkRepoNotificationsAsReadParamSchema = z.object({ + const reposGetCollaboratorPermissionLevelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + username: z.coerce.string(), }) - const activityMarkRepoNotificationsAsReadBodySchema = z - .object({ - last_read_at: z.coerce.string().datetime({ offset: true }).optional(), - }) - .optional() - - router.put( - "activityMarkRepoNotificationsAsRead", - "/repos/:owner/:repo/notifications", + router.get( + "reposGetCollaboratorPermissionLevel", + "/repos/:owner/:repo/collaborators/:username/permission", async (ctx, next) => { const input = { params: parseRequestInput( - activityMarkRepoNotificationsAsReadParamSchema, + reposGetCollaboratorPermissionLevelParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - activityMarkRepoNotificationsAsReadBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.activityMarkRepoNotificationsAsRead(input, ctx) + await implementation.reposGetCollaboratorPermissionLevel(input, ctx) ctx.body = responseValidationFactory( [ - [ - "202", - z.object({ - message: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }), - ], - ["205", z.void()], + ["200", s_repository_collaborator_permission], + ["404", s_basic_error], ], undefined )(status, body) @@ -85563,77 +42502,101 @@ export function bootstrap( } ) - const reposGetPagesParamSchema = z.object({ + const reposListCommitCommentsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) + const reposListCommitCommentsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + router.get( - "reposGetPages", - "/repos/:owner/:repo/pages", + "reposListCommitCommentsForRepo", + "/repos/:owner/:repo/comments", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetPagesParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + reposListCommitCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommitCommentsForRepoQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposGetPages(input, ctx) + const { status, body } = + await implementation.reposListCommitCommentsForRepo(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - url: z.coerce.string(), - status: z.enum(["built", "building", "errored"]), - cname: z.coerce.string(), - protected_domain_state: z - .enum(["pending", "verified", "unverified"]) - .optional(), - pending_domain_unverified_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - custom_404: z.coerce.boolean(), - html_url: z.coerce.string().optional(), - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z - .object({ branch: z.coerce.string(), path: z.coerce.string() }) - .optional(), - public: z.coerce.boolean(), - https_certificate: z - .object({ - state: z.enum([ - "new", - "authorization_created", - "authorization_pending", - "authorized", - "authorization_revoked", - "issued", - "uploaded", - "approved", - "errored", - "bad_authz", - "destroy_pending", - "dns_changed", - ]), - description: z.coerce.string(), - domains: z.array(z.coerce.string()), - expires_at: z.coerce.string().optional(), - }) - .optional(), - https_enforced: z.coerce.boolean().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + z.array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), ], ], undefined @@ -85643,114 +42606,31 @@ export function bootstrap( } ) - const reposCreatePagesSiteParamSchema = z.object({ + const reposGetCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), }) - const reposCreatePagesSiteBodySchema = z.object({ - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z - .object({ - branch: z.coerce.string(), - path: z.enum(["/", "/docs"]).optional(), - }) - .optional(), - }) - - router.post( - "reposCreatePagesSite", - "/repos/:owner/:repo/pages", + router.get( + "reposGetCommitComment", + "/repos/:owner/:repo/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(reposCreatePagesSiteParamSchema, ctx.params), + params: parseRequestInput(reposGetCommitCommentParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposCreatePagesSiteBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reposCreatePagesSite( + const { status, body } = await implementation.reposGetCommitComment( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - status: z.enum(["built", "building", "errored"]), - cname: z.coerce.string(), - protected_domain_state: z - .enum(["pending", "verified", "unverified"]) - .optional(), - pending_domain_unverified_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - custom_404: z.coerce.boolean(), - html_url: z.coerce.string().optional(), - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z - .object({ branch: z.coerce.string(), path: z.coerce.string() }) - .optional(), - public: z.coerce.boolean(), - https_certificate: z - .object({ - state: z.enum([ - "new", - "authorization_created", - "authorization_pending", - "authorized", - "authorization_revoked", - "issued", - "uploaded", - "approved", - "errored", - "bad_authz", - "destroy_pending", - "dns_changed", - ]), - description: z.coerce.string(), - domains: z.array(z.coerce.string()), - expires_at: z.coerce.string().optional(), - }) - .optional(), - https_enforced: z.coerce.boolean().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_commit_comment], + ["404", s_basic_error], ], undefined )(status, body) @@ -85759,83 +42639,38 @@ export function bootstrap( } ) - const reposUpdateInformationAboutPagesSiteParamSchema = z.object({ + const reposUpdateCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), }) - const reposUpdateInformationAboutPagesSiteBodySchema = z.object({ - cname: z.coerce.string().optional(), - https_enforced: z.coerce.boolean().optional(), - build_type: z.enum(["legacy", "workflow"]).optional(), - source: z.object({}).optional(), + const reposUpdateCommitCommentBodySchema = z.object({ + body: z.coerce.string(), }) - router.put( - "reposUpdateInformationAboutPagesSite", - "/repos/:owner/:repo/pages", + router.patch( + "reposUpdateCommitComment", + "/repos/:owner/:repo/comments/:commentId", async (ctx, next) => { const input = { params: parseRequestInput( - reposUpdateInformationAboutPagesSiteParamSchema, + reposUpdateCommitCommentParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - reposUpdateInformationAboutPagesSiteBodySchema, - ctx.body - ), + body: parseRequestInput(reposUpdateCommitCommentBodySchema, ctx.body), } - const { status, body } = - await implementation.reposUpdateInformationAboutPagesSite(input, ctx) + const { status, body } = await implementation.reposUpdateCommitComment( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + [ + ["200", s_commit_comment], + ["404", s_basic_error], ], undefined )(status, body) @@ -85844,22 +42679,26 @@ export function bootstrap( } ) - const reposDeletePagesSiteParamSchema = z.object({ + const reposDeleteCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), }) router.delete( - "reposDeletePagesSite", - "/repos/:owner/:repo/pages", + "reposDeleteCommitComment", + "/repos/:owner/:repo/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeletePagesSiteParamSchema, ctx.params), + params: parseRequestInput( + reposDeleteCommitCommentParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposDeletePagesSite( + const { status, body } = await implementation.reposDeleteCommitComment( input, ctx ) @@ -85867,47 +42706,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -85916,30 +42715,47 @@ export function bootstrap( } ) - const reposListPagesBuildsParamSchema = z.object({ + const reactionsListForCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), }) - const reposListPagesBuildsQuerySchema = z.object({ + const reactionsListForCommitCommentQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "reposListPagesBuilds", - "/repos/:owner/:repo/pages/builds", + "reactionsListForCommitComment", + "/repos/:owner/:repo/comments/:commentId/reactions", async (ctx, next) => { const input = { - params: parseRequestInput(reposListPagesBuildsParamSchema, ctx.params), - query: parseRequestInput(reposListPagesBuildsQuerySchema, ctx.query), + params: parseRequestInput( + reactionsListForCommitCommentParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForCommitCommentQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposListPagesBuilds( - input, - ctx - ) + const { status, body } = + await implementation.reactionsListForCommitComment(input, ctx) ctx.body = responseValidationFactory( [ @@ -85947,10 +42763,9 @@ export function bootstrap( "200", z.array( z.object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -85973,13 +42788,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - commit: z.coerce.string(), - duration: z.coerce.number(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), }) ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -85988,35 +42811,49 @@ export function bootstrap( } ) - const reposRequestPagesBuildParamSchema = z.object({ + const reactionsCreateForCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const reactionsCreateForCommitCommentBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) router.post( - "reposRequestPagesBuild", - "/repos/:owner/:repo/pages/builds", + "reactionsCreateForCommitComment", + "/repos/:owner/:repo/comments/:commentId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - reposRequestPagesBuildParamSchema, + reactionsCreateForCommitCommentParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + reactionsCreateForCommitCommentBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposRequestPagesBuild( - input, - ctx - ) + const { status, body } = + await implementation.reactionsCreateForCommitComment(input, ctx) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ url: z.coerce.string(), status: z.coerce.string() }), - ], + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], ], undefined )(status, body) @@ -86025,223 +42862,195 @@ export function bootstrap( } ) - const reposGetLatestPagesBuildParamSchema = z.object({ + const reactionsDeleteForCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + comment_id: z.coerce.number(), + reaction_id: z.coerce.number(), }) - router.get( - "reposGetLatestPagesBuild", - "/repos/:owner/:repo/pages/builds/latest", + router.delete( + "reactionsDeleteForCommitComment", + "/repos/:owner/:repo/comments/:commentId/reactions/:reactionId", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetLatestPagesBuildParamSchema, + reactionsDeleteForCommitCommentParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetLatestPagesBuild( - input, - ctx - ) + const { status, body } = + await implementation.reactionsDeleteForCommitComment(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - commit: z.coerce.string(), - duration: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetPagesBuildParamSchema = z.object({ + const reposListCommitsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - build_id: z.coerce.number(), + }) + + const reposListCommitsQuerySchema = z.object({ + sha: z.coerce.string().optional(), + path: z.coerce.string().optional(), + author: z.coerce.string().optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + until: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetPagesBuild", - "/repos/:owner/:repo/pages/builds/:buildId", + "reposListCommits", + "/repos/:owner/:repo/commits", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetPagesBuildParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(reposListCommitsParamSchema, ctx.params), + query: parseRequestInput(reposListCommitsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposGetPagesBuild( - input, - ctx - ) + const { status, body } = await implementation.reposListCommits(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + z.array( + z.object({ url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - commit: z.coerce.string(), - duration: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreatePagesDeploymentParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreatePagesDeploymentBodySchema = z.object({ - artifact_url: z.coerce.string(), - environment: z.coerce.string().optional(), - pages_build_version: z.coerce.string(), - oidc_token: z.coerce.string(), - }) - - router.post( - "reposCreatePagesDeployment", - "/repos/:owner/:repo/pages/deployment", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreatePagesDeploymentParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreatePagesDeploymentBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreatePagesDeployment( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - status_url: z.coerce.string(), - page_url: z.coerce.string(), - preview_url: z.coerce.string().optional(), - }), - ], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), }) - ) - .optional(), - }), + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ), ], + ["400", s_scim_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -86250,116 +43059,44 @@ export function bootstrap( } ) - const reposGetPagesHealthCheckParamSchema = z.object({ + const reposListBranchesForHeadCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + commit_sha: z.coerce.string(), }) router.get( - "reposGetPagesHealthCheck", - "/repos/:owner/:repo/pages/health", + "reposListBranchesForHeadCommit", + "/repos/:owner/:repo/commits/:commitSha/branches-where-head", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetPagesHealthCheckParamSchema, + reposListBranchesForHeadCommitParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetPagesHealthCheck( - input, - ctx - ) + const { status, body } = + await implementation.reposListBranchesForHeadCommit(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - domain: z - .object({ - host: z.coerce.string().optional(), - uri: z.coerce.string().optional(), - nameservers: z.coerce.string().optional(), - dns_resolves: z.coerce.boolean().optional(), - is_proxied: z.coerce.boolean().optional(), - is_cloudflare_ip: z.coerce.boolean().optional(), - is_fastly_ip: z.coerce.boolean().optional(), - is_old_ip_address: z.coerce.boolean().optional(), - is_a_record: z.coerce.boolean().optional(), - has_cname_record: z.coerce.boolean().optional(), - has_mx_records_present: z.coerce.boolean().optional(), - is_valid_domain: z.coerce.boolean().optional(), - is_apex_domain: z.coerce.boolean().optional(), - should_be_a_record: z.coerce.boolean().optional(), - is_cname_to_github_user_domain: z.coerce.boolean().optional(), - is_cname_to_pages_dot_github_dot_com: z.coerce - .boolean() - .optional(), - is_cname_to_fastly: z.coerce.boolean().optional(), - is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), - is_non_github_pages_ip_present: z.coerce.boolean().optional(), - is_pages_domain: z.coerce.boolean().optional(), - is_served_by_pages: z.coerce.boolean().optional(), - is_valid: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - responds_to_https: z.coerce.boolean().optional(), - enforces_https: z.coerce.boolean().optional(), - https_error: z.coerce.string().optional(), - is_https_eligible: z.coerce.boolean().optional(), - caa_error: z.coerce.string().optional(), - }) - .optional(), - alt_domain: z - .object({ - host: z.coerce.string().optional(), - uri: z.coerce.string().optional(), - nameservers: z.coerce.string().optional(), - dns_resolves: z.coerce.boolean().optional(), - is_proxied: z.coerce.boolean().optional(), - is_cloudflare_ip: z.coerce.boolean().optional(), - is_fastly_ip: z.coerce.boolean().optional(), - is_old_ip_address: z.coerce.boolean().optional(), - is_a_record: z.coerce.boolean().optional(), - has_cname_record: z.coerce.boolean().optional(), - has_mx_records_present: z.coerce.boolean().optional(), - is_valid_domain: z.coerce.boolean().optional(), - is_apex_domain: z.coerce.boolean().optional(), - should_be_a_record: z.coerce.boolean().optional(), - is_cname_to_github_user_domain: z.coerce.boolean().optional(), - is_cname_to_pages_dot_github_dot_com: z.coerce - .boolean() - .optional(), - is_cname_to_fastly: z.coerce.boolean().optional(), - is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), - is_non_github_pages_ip_present: z.coerce.boolean().optional(), - is_pages_domain: z.coerce.boolean().optional(), - is_served_by_pages: z.coerce.boolean().optional(), - is_valid: z.coerce.boolean().optional(), - reason: z.coerce.string().optional(), - responds_to_https: z.coerce.boolean().optional(), - enforces_https: z.coerce.boolean().optional(), - https_error: z.coerce.string().optional(), - is_https_eligible: z.coerce.boolean().optional(), - caa_error: z.coerce.string().optional(), - }) - .optional(), - }), - ], - ["202", z.object({})], - ["400", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + z.array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + protected: z.coerce.boolean(), + }) + ), ], - ["422", z.void()], + ["422", s_validation_error], ], undefined )(status, body) @@ -86368,28 +43105,34 @@ export function bootstrap( } ) - const projectsListForRepoParamSchema = z.object({ + const reposListCommentsForCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + commit_sha: z.coerce.string(), }) - const projectsListForRepoQuerySchema = z.object({ - state: z.enum(["open", "closed", "all"]).optional(), + const reposListCommentsForCommitQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "projectsListForRepo", - "/repos/:owner/:repo/projects", + "reposListCommentsForCommit", + "/repos/:owner/:repo/commits/:commitSha/comments", async (ctx, next) => { const input = { - params: parseRequestInput(projectsListForRepoParamSchema, ctx.params), - query: parseRequestInput(projectsListForRepoQuerySchema, ctx.query), + params: parseRequestInput( + reposListCommentsForCommitParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommentsForCommitQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.projectsListForRepo( + const { status, body } = await implementation.reposListCommentsForCommit( input, ctx ) @@ -86400,17 +43143,16 @@ export function bootstrap( "200", z.array( z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), html_url: z.coerce.string(), - columns_url: z.coerce.string(), + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86435,57 +43177,33 @@ export function bootstrap( }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) .optional(), - private: z.coerce.boolean().optional(), }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], ], undefined )(status, body) @@ -86494,121 +43212,42 @@ export function bootstrap( } ) - const projectsCreateForRepoParamSchema = z.object({ + const reposCreateCommitCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + commit_sha: z.coerce.string(), }) - const projectsCreateForRepoBodySchema = z.object({ - name: z.coerce.string(), - body: z.coerce.string().optional(), + const reposCreateCommitCommentBodySchema = z.object({ + body: z.coerce.string(), + path: z.coerce.string().optional(), + position: z.coerce.number().optional(), + line: z.coerce.number().optional(), }) router.post( - "projectsCreateForRepo", - "/repos/:owner/:repo/projects", + "reposCreateCommitComment", + "/repos/:owner/:repo/commits/:commitSha/comments", async (ctx, next) => { const input = { - params: parseRequestInput(projectsCreateForRepoParamSchema, ctx.params), + params: parseRequestInput( + reposCreateCommitCommentParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(projectsCreateForRepoBodySchema, ctx.body), + body: parseRequestInput(reposCreateCommitCommentBodySchema, ctx.body), } - const { status, body } = await implementation.projectsCreateForRepo( + const { status, body } = await implementation.reposCreateCommitComment( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "410", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["201", s_commit_comment], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -86617,100 +43256,143 @@ export function bootstrap( } ) - const pullsListParamSchema = z.object({ + const reposListPullRequestsAssociatedWithCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + commit_sha: z.coerce.string(), }) - const pullsListQuerySchema = z.object({ - state: z.enum(["open", "closed", "all"]).optional(), - head: z.coerce.string().optional(), - base: z.coerce.string().optional(), - sort: z - .enum(["created", "updated", "popularity", "long-running"]) - .optional(), - direction: z.enum(["asc", "desc"]).optional(), + const reposListPullRequestsAssociatedWithCommitQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get("pullsList", "/repos/:owner/:repo/pulls", async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListParamSchema, ctx.params), - query: parseRequestInput(pullsListQuerySchema, ctx.query), - body: undefined, - } + router.get( + "reposListPullRequestsAssociatedWithCommit", + "/repos/:owner/:repo/commits/:commitSha/pulls", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListPullRequestsAssociatedWithCommitParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListPullRequestsAssociatedWithCommitQuerySchema, + ctx.query + ), + body: undefined, + } - const { status, body } = await implementation.pullsList(input, ctx) + const { status, body } = + await implementation.reposListPullRequestsAssociatedWithCommit( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ + ctx.body = responseValidationFactory( [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - name: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86733,45 +43415,735 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86793,12 +44165,30 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86820,67 +44210,422 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCommitParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const reposGetCommitQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + router.get( + "reposGetCommit", + "/repos/:owner/:repo/commits/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetCommitParamSchema, ctx.params), + query: parseRequestInput(reposGetCommitQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetCommit(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_commit], + ["404", s_basic_error], + ["422", s_validation_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksListForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const checksListForRefQuerySchema = z.object({ + check_name: z.coerce.string().optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + filter: z.enum(["latest", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + app_id: z.coerce.number().optional(), + }) + + router.get( + "checksListForRef", + "/repos/:owner/:repo/commits/:ref/check-runs", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksListForRefParamSchema, ctx.params), + query: parseRequestInput(checksListForRefQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.checksListForRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), name: z.coerce.string(), - slug: z.coerce.string(), description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const checksListSuitesForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const checksListSuitesForRefQuerySchema = z.object({ + app_id: z.coerce.number().optional(), + check_name: z.coerce.string().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "checksListSuitesForRef", + "/repos/:owner/:repo/commits/:ref/check-suites", + async (ctx, next) => { + const input = { + params: parseRequestInput( + checksListSuitesForRefParamSchema, + ctx.params + ), + query: parseRequestInput(checksListSuitesForRefQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.checksListSuitesForRef( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_suites: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }), - organization: z - .object({ + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -86902,271 +44647,262 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCombinedStatusForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const reposGetCombinedStatusForRefQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposGetCombinedStatusForRef", + "/repos/:owner/:repo/commits/:ref/status", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCombinedStatusForRefParamSchema, + ctx.params + ), + query: parseRequestInput( + reposGetCombinedStatusForRefQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposGetCombinedStatusForRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_combined_commit_status], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListCommitStatusesForRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const reposListCommitStatusesForRefQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListCommitStatusesForRef", + "/repos/:owner/:repo/commits/:ref/statuses", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCommitStatusesForRefParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommitStatusesForRefQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListCommitStatusesForRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87189,356 +44925,443 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + }) + ), + ], + ["301", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCommunityProfileMetricsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetCommunityProfileMetrics", + "/repos/:owner/:repo/community/profile", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCommunityProfileMetricsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetCommunityProfileMetrics(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_community_profile]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCompareCommitsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + basehead: z.coerce.string(), + }) + + const reposCompareCommitsQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + router.get( + "reposCompareCommits", + "/repos/:owner/:repo/compare/:basehead", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCompareCommitsParamSchema, ctx.params), + query: parseRequestInput(reposCompareCommitsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposCompareCommits( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_commit_comparison], + ["404", s_basic_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetContentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + path: z.coerce.string(), + }) + + const reposGetContentQuerySchema = z.object({ + ref: z.coerce.string().optional(), + }) + + router.get( + "reposGetContent", + "/repos/:owner/:repo/contents/:path", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetContentParamSchema, ctx.params), + query: parseRequestInput(reposGetContentQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetContent(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.union([ + s_content_directory, + s_content_file, + s_content_symlink, + s_content_submodule, + ]), + ], + ["302", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateOrUpdateFileContentsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + path: z.coerce.string(), + }) + + const reposCreateOrUpdateFileContentsBodySchema = z.object({ + message: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + committer: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().optional(), + }) + .optional(), + author: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().optional(), + }) + .optional(), + }) + + router.put( + "reposCreateOrUpdateFileContents", + "/repos/:owner/:repo/contents/:path", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateOrUpdateFileContentsParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposCreateOrUpdateFileContentsBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposCreateOrUpdateFileContents(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_file_commit], + ["201", s_file_commit], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteFileParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + path: z.coerce.string(), + }) + + const reposDeleteFileBodySchema = z.object({ + message: z.coerce.string(), + sha: z.coerce.string(), + branch: z.coerce.string().optional(), + committer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + author: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + }) + + router.delete( + "reposDeleteFile", + "/repos/:owner/:repo/contents/:path", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteFileParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposDeleteFileBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposDeleteFile(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_file_commit], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListContributorsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListContributorsQuerySchema = z.object({ + anon: z.coerce.string().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListContributors", + "/repos/:owner/:repo/contributors", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListContributorsParamSchema, ctx.params), + query: parseRequestInput(reposListContributorsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListContributors( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string(), + site_admin: z.coerce.boolean().optional(), + contributions: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ), + ], + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotListAlertsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const dependabotListAlertsForRepoQuerySchema = z.object({ + state: z.coerce.string().optional(), + severity: z.coerce.string().optional(), + ecosystem: z.coerce.string().optional(), + package: z.coerce.string().optional(), + manifest: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + first: z.coerce.number().optional(), + last: z.coerce.number().optional(), + }) + + router.get( + "dependabotListAlertsForRepo", + "/repos/:owner/:repo/dependabot/alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotListAlertsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + dependabotListAlertsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.dependabotListAlertsForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + ecosystem: z.coerce.string(), + name: z.coerce.string(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87561,197 +45384,446 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }) - ), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], - ["304", z.void()], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotGetAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), + }) + + router.get( + "dependabotGetAlert", + "/repos/:owner/:repo/dependabot/alerts/:alertNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(dependabotGetAlertParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.dependabotGetAlert( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_dependabot_alert], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotUpdateAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), + }) + + const dependabotUpdateAlertBodySchema = z.object({ + state: z.enum(["dismissed", "open"]), + dismissed_reason: z + .enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]) + .optional(), + dismissed_comment: z.coerce.string().optional(), + }) + + router.patch( + "dependabotUpdateAlert", + "/repos/:owner/:repo/dependabot/alerts/:alertNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(dependabotUpdateAlertParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(dependabotUpdateAlertBodySchema, ctx.body), + } + + const { status, body } = await implementation.dependabotUpdateAlert( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_dependabot_alert], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotListRepoSecretsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const dependabotListRepoSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "dependabotListRepoSecrets", + "/repos/:owner/:repo/dependabot/secrets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotListRepoSecretsParamSchema, + ctx.params + ), + query: parseRequestInput( + dependabotListRepoSecretsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.dependabotListRepoSecrets( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotGetRepoPublicKeyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "dependabotGetRepoPublicKey", + "/repos/:owner/:repo/dependabot/secrets/public-key", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotGetRepoPublicKeyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.dependabotGetRepoPublicKey( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_dependabot_public_key]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotGetRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.get( + "dependabotGetRepoSecret", + "/repos/:owner/:repo/dependabot/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotGetRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.dependabotGetRepoSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_dependabot_secret]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotCreateOrUpdateRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const dependabotCreateOrUpdateRepoSecretBodySchema = z.object({ + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string().optional(), + }) + + router.put( + "dependabotCreateOrUpdateRepoSecret", + "/repos/:owner/:repo/dependabot/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotCreateOrUpdateRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + dependabotCreateOrUpdateRepoSecretBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.dependabotCreateOrUpdateRepoSecret(input, ctx) + + ctx.body = responseValidationFactory( [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + ["201", s_empty_object], + ["204", z.void()], ], - ], - undefined - )(status, body) - ctx.status = status - return next() + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const dependabotDeleteRepoSecretParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + secret_name: z.coerce.string(), }) - const pullsCreateParamSchema = z.object({ + router.delete( + "dependabotDeleteRepoSecret", + "/repos/:owner/:repo/dependabot/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotDeleteRepoSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.dependabotDeleteRepoSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const dependencyGraphDiffRangeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + basehead: z.coerce.string(), }) - const pullsCreateBodySchema = z.object({ - title: z.coerce.string().optional(), - head: z.coerce.string(), - base: z.coerce.string(), - body: z.coerce.string().optional(), - maintainer_can_modify: z.coerce.boolean().optional(), - draft: z.coerce.boolean().optional(), - issue: z.coerce.number().optional(), + const dependencyGraphDiffRangeQuerySchema = z.object({ + name: z.coerce.string().optional(), }) - router.post("pullsCreate", "/repos/:owner/:repo/pulls", async (ctx, next) => { - const input = { - params: parseRequestInput(pullsCreateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsCreateBodySchema, ctx.body), + router.get( + "dependencyGraphDiffRange", + "/repos/:owner/:repo/dependency-graph/compare/:basehead", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependencyGraphDiffRangeParamSchema, + ctx.params + ), + query: parseRequestInput( + dependencyGraphDiffRangeQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.dependencyGraphDiffRange( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_dependency_graph_diff], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.pullsCreate(input, ctx) + const dependencyGraphCreateRepositorySnapshotParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) - ctx.body = responseValidationFactory( - [ + const dependencyGraphCreateRepositorySnapshotBodySchema = s_snapshot + + router.post( + "dependencyGraphCreateRepositorySnapshot", + "/repos/:owner/:repo/dependency-graph/snapshots", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependencyGraphCreateRepositorySnapshotParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + dependencyGraphCreateRepositorySnapshotBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.dependencyGraphCreateRepositorySnapshot(input, ctx) + + ctx.body = responseValidationFactory( [ - "201", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + [ + "201", + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + created_at: z.coerce.string(), + result: z.coerce.string(), + message: z.coerce.string(), }), - body: z.coerce.string(), - labels: z.array( + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListDeploymentsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListDeploymentsQuerySchema = z.object({ + sha: z.coerce.string().optional(), + ref: z.coerce.string().optional(), + task: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListDeployments", + "/repos/:owner/:repo/deployments", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListDeploymentsParamSchema, ctx.params), + query: parseRequestInput(reposListDeploymentsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListDeployments( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87773,12 +45845,237 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateDeploymentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposCreateDeploymentBodySchema = z.object({ + ref: z.coerce.string(), + task: z.coerce.string().optional(), + auto_merge: z.coerce.boolean().optional(), + required_contexts: z.array(z.coerce.string()).optional(), + payload: z.union([z.object({}), z.coerce.string()]), + environment: z.coerce.string().optional(), + description: z.coerce.string().optional(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateDeployment", + "/repos/:owner/:repo/deployments", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateDeploymentParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateDeploymentBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateDeployment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_deployment], + ["202", z.object({ message: z.coerce.string().optional() })], + ["409", z.void()], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetDeploymentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + deployment_id: z.coerce.number(), + }) + + router.get( + "reposGetDeployment", + "/repos/:owner/:repo/deployments/:deploymentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetDeploymentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetDeployment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_deployment], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteDeploymentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + deployment_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteDeployment", + "/repos/:owner/:repo/deployments/:deploymentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteDeploymentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeleteDeployment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListDeploymentStatusesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + deployment_id: z.coerce.number(), + }) + + const reposListDeploymentStatusesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListDeploymentStatuses", + "/repos/:owner/:repo/deployments/:deploymentId/statuses", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListDeploymentStatusesParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListDeploymentStatusesQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.reposListDeploymentStatuses( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -87800,559 +46097,203 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - merged: z.coerce.boolean(), - mergeable: z.coerce.boolean(), - rebaseable: z.coerce.boolean().optional(), - mergeable_state: z.coerce.string(), - merged_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments: z.coerce.number(), - review_comments: z.coerce.number(), - maintainer_can_modify: z.coerce.boolean(), - commits: z.coerce.number(), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changed_files: z.coerce.number(), - }), + }) + ), + ], + ["404", s_basic_error], ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateDeploymentStatusParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + deployment_id: z.coerce.number(), + }) + + const reposCreateDeploymentStatusBodySchema = z.object({ + state: z.enum([ + "error", + "failure", + "inactive", + "in_progress", + "queued", + "pending", + "success", + ]), + target_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + environment: z.enum(["production", "staging", "qa"]).optional(), + environment_url: z.coerce.string().optional(), + auto_inactive: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateDeploymentStatus", + "/repos/:owner/:repo/deployments/:deploymentId/statuses", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateDeploymentStatusParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposCreateDeploymentStatusBodySchema, + ctx.body + ), + } + + const { status, body } = await implementation.reposCreateDeploymentStatus( + input, + ctx + ) + + ctx.body = responseValidationFactory( [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + ["201", s_deployment_status], + ["422", s_validation_error], ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetDeploymentStatusParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + deployment_id: z.coerce.number(), + status_id: z.coerce.number(), + }) + + router.get( + "reposGetDeploymentStatus", + "/repos/:owner/:repo/deployments/:deploymentId/statuses/:statusId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetDeploymentStatusParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetDeploymentStatus( + input, + ctx + ) + + ctx.body = responseValidationFactory( [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + ["200", s_deployment_status], + ["404", s_basic_error], ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const pullsListReviewCommentsForRepoParamSchema = z.object({ + const reposCreateDispatchEventParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const pullsListReviewCommentsForRepoQuerySchema = z.object({ - sort: z.enum(["created", "updated", "created_at"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposCreateDispatchEventBodySchema = z.object({ + event_type: z.coerce.string(), + client_payload: z.object({}).optional(), }) - router.get( - "pullsListReviewCommentsForRepo", - "/repos/:owner/:repo/pulls/comments", + router.post( + "reposCreateDispatchEvent", + "/repos/:owner/:repo/dispatches", async (ctx, next) => { const input = { params: parseRequestInput( - pullsListReviewCommentsForRepoParamSchema, + reposCreateDispatchEventParamSchema, ctx.params ), - query: parseRequestInput( - pullsListReviewCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, + query: undefined, + body: parseRequestInput(reposCreateDispatchEventBodySchema, ctx.body), } - const { status, body } = - await implementation.pullsListReviewCommentsForRepo(input, ctx) + const { status, body } = await implementation.reposCreateDispatchEvent( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - ), - ], + ["204", z.void()], + ["422", s_validation_error], ], undefined )(status, body) @@ -88361,23 +46302,30 @@ export function bootstrap( } ) - const pullsGetReviewCommentParamSchema = z.object({ + const reposGetAllEnvironmentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + }) + + const reposGetAllEnvironmentsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "pullsGetReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId", + "reposGetAllEnvironments", + "/repos/:owner/:repo/environments", async (ctx, next) => { const input = { - params: parseRequestInput(pullsGetReviewCommentParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + reposGetAllEnvironmentsParamSchema, + ctx.params + ), + query: parseRequestInput(reposGetAllEnvironmentsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.pullsGetReviewComment( + const { status, body } = await implementation.reposGetAllEnvironments( input, ctx ) @@ -88387,91 +46335,27 @@ export function bootstrap( [ "200", z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) + total_count: z.coerce.number().optional(), + environments: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + ) .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -88482,117 +46366,85 @@ export function bootstrap( } ) - const pullsUpdateReviewCommentParamSchema = z.object({ + const reposGetEnvironmentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - const pullsUpdateReviewCommentBodySchema = z.object({ - body: z.coerce.string(), + router.get( + "reposGetEnvironment", + "/repos/:owner/:repo/environments/:environmentName", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetEnvironmentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetEnvironment( + input, + ctx + ) + + ctx.body = responseValidationFactory([["200", s_environment]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposCreateOrUpdateEnvironmentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + environment_name: z.coerce.string(), }) - router.patch( - "pullsUpdateReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId", + const reposCreateOrUpdateEnvironmentBodySchema = z + .object({ + wait_timer: z.coerce.number().optional(), + reviewers: z + .array( + z.object({ + type: z.enum(["User", "Team"]).optional(), + id: z.coerce.number().optional(), + }) + ) + .optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + .optional() + + router.put( + "reposCreateOrUpdateEnvironment", + "/repos/:owner/:repo/environments/:environmentName", async (ctx, next) => { const input = { params: parseRequestInput( - pullsUpdateReviewCommentParamSchema, + reposCreateOrUpdateEnvironmentParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(pullsUpdateReviewCommentBodySchema, ctx.body), + body: parseRequestInput( + reposCreateOrUpdateEnvironmentBodySchema, + ctx.body + ), } - const { status, body } = await implementation.pullsUpdateReviewComment( - input, - ctx - ) + const { status, body } = + await implementation.reposCreateOrUpdateEnvironment(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }), - ], + ["200", s_environment], + ["422", s_basic_error], ], undefined )(status, body) @@ -88601,40 +46453,82 @@ export function bootstrap( } ) - const pullsDeleteReviewCommentParamSchema = z.object({ + const reposDeleteAnEnvironmentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + environment_name: z.coerce.string(), }) router.delete( - "pullsDeleteReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId", + "reposDeleteAnEnvironment", + "/repos/:owner/:repo/environments/:environmentName", async (ctx, next) => { const input = { params: parseRequestInput( - pullsDeleteReviewCommentParamSchema, + reposDeleteAnEnvironmentParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.pullsDeleteReviewComment( + const { status, body } = await implementation.reposDeleteAnEnvironment( input, ctx ) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListDeploymentBranchPoliciesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + environment_name: z.coerce.string(), + }) + + const reposListDeploymentBranchPoliciesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListDeploymentBranchPolicies", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListDeploymentBranchPoliciesParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListDeploymentBranchPoliciesQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListDeploymentBranchPolicies(input, ctx) + ctx.body = responseValidationFactory( [ - ["204", z.void()], [ - "404", + "200", z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), + total_count: z.coerce.number(), + branch_policies: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ), }), ], ], @@ -88645,106 +46539,72 @@ export function bootstrap( } ) - const reactionsListForPullRequestReviewCommentParamSchema = z.object({ + const reposCreateDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - const reactionsListForPullRequestReviewCommentQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposCreateDeploymentBranchPolicyBodySchema = + s_deployment_branch_policy_name_pattern + + router.post( + "reposCreateDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposCreateDeploymentBranchPolicyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + reposCreateDeploymentBranchPolicyBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposCreateDeploymentBranchPolicy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_deployment_branch_policy], + ["303", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetDeploymentBranchPolicyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + environment_name: z.coerce.string(), + branch_policy_id: z.coerce.number(), }) router.get( - "reactionsListForPullRequestReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId/reactions", + "reposGetDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsListForPullRequestReviewCommentParamSchema, + reposGetDeploymentBranchPolicyParamSchema, ctx.params ), - query: parseRequestInput( - reactionsListForPullRequestReviewCommentQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } const { status, body } = - await implementation.reactionsListForPullRequestReviewComment( - input, - ctx - ) + await implementation.reposGetDeploymentBranchPolicy(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], + [["200", s_deployment_branch_policy]], undefined )(status, body) ctx.status = status @@ -88752,155 +46612,37 @@ export function bootstrap( } ) - const reactionsCreateForPullRequestReviewCommentParamSchema = z.object({ + const reposUpdateDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), + environment_name: z.coerce.string(), + branch_policy_id: z.coerce.number(), }) - const reactionsCreateForPullRequestReviewCommentBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) + const reposUpdateDeploymentBranchPolicyBodySchema = + s_deployment_branch_policy_name_pattern - router.post( - "reactionsCreateForPullRequestReviewComment", - "/repos/:owner/:repo/pulls/comments/:commentId/reactions", + router.put( + "reposUpdateDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsCreateForPullRequestReviewCommentParamSchema, + reposUpdateDeploymentBranchPolicyParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - reactionsCreateForPullRequestReviewCommentBodySchema, + reposUpdateDeploymentBranchPolicyBodySchema, ctx.body ), } const { status, body } = - await implementation.reactionsCreateForPullRequestReviewComment( - input, - ctx - ) + await implementation.reposUpdateDeploymentBranchPolicy(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], + [["200", s_deployment_branch_policy]], undefined )(status, body) ctx.status = status @@ -88908,20 +46650,20 @@ export function bootstrap( } ) - const reactionsDeleteForPullRequestCommentParamSchema = z.object({ + const reposDeleteDeploymentBranchPolicyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - comment_id: z.coerce.number(), - reaction_id: z.coerce.number(), + environment_name: z.coerce.string(), + branch_policy_id: z.coerce.number(), }) router.delete( - "reactionsDeleteForPullRequestComment", - "/repos/:owner/:repo/pulls/comments/:commentId/reactions/:reactionId", + "reposDeleteDeploymentBranchPolicy", + "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsDeleteForPullRequestCommentParamSchema, + reposDeleteDeploymentBranchPolicyParamSchema, ctx.params ), query: undefined, @@ -88929,7 +46671,7 @@ export function bootstrap( } const { status, body } = - await implementation.reactionsDeleteForPullRequestComment(input, ctx) + await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -88940,623 +46682,795 @@ export function bootstrap( } ) - const pullsGetParamSchema = z.object({ + const activityListRepoEventsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), + }) + + const activityListRepoEventsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "pullsGet", - "/repos/:owner/:repo/pulls/:pullNumber", + "activityListRepoEvents", + "/repos/:owner/:repo/events", async (ctx, next) => { const input = { - params: parseRequestInput(pullsGetParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + activityListRepoEventsParamSchema, + ctx.params + ), + query: parseRequestInput(activityListRepoEventsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.pullsGet(input, ctx) + const { status, body } = await implementation.activityListRepoEvents( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce + .string() + .optional(), + organizations_url: z.coerce + .string() + .optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce + .boolean() + .optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce + .boolean() + .optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z + comment: z .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - merged: z.coerce.boolean(), - mergeable: z.coerce.boolean(), - rebaseable: z.coerce.boolean().optional(), - mergeable_state: z.coerce.string(), - merged_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments: z.coerce.number(), - review_comments: z.coerce.number(), - maintainer_can_modify: z.coerce.boolean(), - commits: z.coerce.number(), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changed_files: z.coerce.number(), - }), - ], - ["304", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], ], undefined @@ -89566,639 +47480,790 @@ export function bootstrap( } ) - const pullsUpdateParamSchema = z.object({ + const reposListForksParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsUpdateBodySchema = z - .object({ - title: z.coerce.string().optional(), - body: z.coerce.string().optional(), - state: z.enum(["open", "closed"]).optional(), - base: z.coerce.string().optional(), - maintainer_can_modify: z.coerce.boolean().optional(), - }) - .optional() - - router.patch( - "pullsUpdate", - "/repos/:owner/:repo/pulls/:pullNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsUpdateParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsUpdateBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsUpdate(input, ctx) + const reposListForksQuerySchema = z.object({ + sort: z.enum(["newest", "oldest", "stargazers", "watchers"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - description: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - fork: z.coerce.boolean(), - forks_url: z.coerce.string(), - full_name: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - hooks_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - node_id: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - name: z.coerce.string(), - notifications_url: z.coerce.string(), - owner: z.object({ - avatar_url: z.coerce.string(), - events_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), - organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), - repos_url: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - type: z.coerce.string(), - url: z.coerce.string(), - }), - private: z.coerce.boolean(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - url: z.coerce.string(), - clone_url: z.coerce.string(), - default_branch: z.coerce.string(), - forks: z.coerce.number(), - forks_count: z.coerce.number(), - git_url: z.coerce.string(), - has_downloads: z.coerce.boolean(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - homepage: z.coerce.string(), - language: z.coerce.string(), - master_branch: z.coerce.string().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - mirror_url: z.coerce.string(), - open_issues: z.coerce.number(), - open_issues_count: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - pushed_at: z.coerce.string().datetime({ offset: true }), - size: z.coerce.number(), - ssh_url: z.coerce.string(), - stargazers_count: z.coerce.number(), - svn_url: z.coerce.string(), - topics: z.array(z.coerce.string()).optional(), - watchers: z.coerce.number(), - watchers_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ + router.get( + "reposListForks", + "/repos/:owner/:repo/forks", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListForksParamSchema, ctx.params), + query: parseRequestInput(reposListForksQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListForks(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), avatar_url: z.coerce.string(), - events_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), followers_url: z.coerce.string(), following_url: z.coerce.string(), gists_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - login: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), organizations_url: z.coerce.string(), - received_events_url: z.coerce.string(), repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), site_admin: z.coerce.boolean(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ["400", s_scim_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateForkParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposCreateForkBodySchema = z + .object({ + organization: z.coerce.string().optional(), + name: z.coerce.string().optional(), + default_branch_only: z.coerce.boolean().optional(), + }) + .optional() + + router.post( + "reposCreateFork", + "/repos/:owner/:repo/forks", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateForkParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateForkBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateFork(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["202", s_full_repository], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateBlobParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateBlobBodySchema = z.object({ + content: z.coerce.string(), + encoding: z.coerce.string().optional(), + }) + + router.post( + "gitCreateBlob", + "/repos/:owner/:repo/git/blobs", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateBlobParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateBlobBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateBlob(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_short_blob], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetBlobParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + file_sha: z.coerce.string(), + }) + + router.get( + "gitGetBlob", + "/repos/:owner/:repo/git/blobs/:fileSha", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetBlobParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetBlob(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_blob], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateCommitParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateCommitBodySchema = z.object({ + message: z.coerce.string(), + tree: z.coerce.string(), + parents: z.array(z.coerce.string()).optional(), + author: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional(), + committer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional(), + signature: z.coerce.string().optional(), + }) + + router.post( + "gitCreateCommit", + "/repos/:owner/:repo/git/commits", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateCommitParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateCommitBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateCommit(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_git_commit], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetCommitParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + commit_sha: z.coerce.string(), + }) + + router.get( + "gitGetCommit", + "/repos/:owner/:repo/git/commits/:commitSha", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetCommitParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetCommit(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_git_commit], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitListMatchingRefsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.get( + "gitListMatchingRefs", + "/repos/:owner/:repo/git/matching-refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitListMatchingRefsParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitListMatchingRefs( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ type: z.coerce.string(), + sha: z.coerce.string(), url: z.coerce.string(), }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.get( + "gitGetRef", + "/repos/:owner/:repo/git/ref/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetRefParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_git_ref], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateRefBodySchema = z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + key: z.coerce.string().optional(), + }) + + router.post( + "gitCreateRef", + "/repos/:owner/:repo/git/refs", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateRefParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateRefBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_git_ref], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitUpdateRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + const gitUpdateRefBodySchema = z.object({ + sha: z.coerce.string(), + force: z.coerce.boolean().optional(), + }) + + router.patch( + "gitUpdateRef", + "/repos/:owner/:repo/git/refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitUpdateRefParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitUpdateRefBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitUpdateRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_git_ref], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitDeleteRefParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), + }) + + router.delete( + "gitDeleteRef", + "/repos/:owner/:repo/git/refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitDeleteRefParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitDeleteRef(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateTagParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateTagBodySchema = z.object({ + tag: z.coerce.string(), + message: z.coerce.string(), + object: z.coerce.string(), + type: z.enum(["commit", "tree", "blob"]), + tagger: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional(), + }) + + router.post( + "gitCreateTag", + "/repos/:owner/:repo/git/tags", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateTagParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateTagBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateTag(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_git_tag], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetTagParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + tag_sha: z.coerce.string(), + }) + + router.get( + "gitGetTag", + "/repos/:owner/:repo/git/tags/:tagSha", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetTagParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gitGetTag(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_git_tag], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitCreateTreeParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const gitCreateTreeBodySchema = z.object({ + tree: z.array( + z.object({ + path: z.coerce.string().optional(), + mode: z + .enum(["100644", "100755", "040000", "160000", "120000"]) + .optional(), + type: z.enum(["blob", "tree", "commit"]).optional(), + sha: z.coerce.string().optional(), + content: z.coerce.string().optional(), + }) + ), + base_tree: z.coerce.string().optional(), + }) + + router.post( + "gitCreateTree", + "/repos/:owner/:repo/git/trees", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitCreateTreeParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(gitCreateTreeBodySchema, ctx.body), + } + + const { status, body } = await implementation.gitCreateTree(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_git_tree], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const gitGetTreeParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + tree_sha: z.coerce.string(), + }) + + const gitGetTreeQuerySchema = z.object({ + recursive: z.coerce.string().optional(), + }) + + router.get( + "gitGetTree", + "/repos/:owner/:repo/git/trees/:treeSha", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitGetTreeParamSchema, ctx.params), + query: parseRequestInput(gitGetTreeQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gitGetTree(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_git_tree], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListWebhooksParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListWebhooksQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListWebhooks", + "/repos/:owner/:repo/hooks", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListWebhooksParamSchema, ctx.params), + query: parseRequestInput(reposListWebhooksQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListWebhooks( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - merged: z.coerce.boolean(), - mergeable: z.coerce.boolean(), - rebaseable: z.coerce.boolean().optional(), - mergeable_state: z.coerce.string(), - merged_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments: z.coerce.number(), - review_comments: z.coerce.number(), - maintainer_can_modify: z.coerce.boolean(), - commits: z.coerce.number(), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changed_files: z.coerce.number(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -90207,659 +48272,301 @@ export function bootstrap( } ) - const codespacesCreateWithPrForAuthenticatedUserParamSchema = z.object({ + const reposCreateWebhookParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const codespacesCreateWithPrForAuthenticatedUserBodySchema = z.object({ - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - multi_repo_permissions_opt_out: z.coerce.boolean().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - display_name: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), + const reposCreateWebhookBodySchema = z + .object({ + name: z.coerce.string().optional(), + config: z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + token: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + active: z.coerce.boolean().optional(), + }) + .optional() + + router.post( + "reposCreateWebhook", + "/repos/:owner/:repo/hooks", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateWebhookParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateWebhookBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_hook], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.get( + "reposGetWebhook", + "/repos/:owner/:repo/hooks/:hookId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetWebhook(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_hook], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + const reposUpdateWebhookBodySchema = z.object({ + config: z + .object({ + url: z.coerce.string(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + address: z.coerce.string().optional(), + room: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + add_events: z.array(z.coerce.string()).optional(), + remove_events: z.array(z.coerce.string()).optional(), + active: z.coerce.boolean().optional(), + }) + + router.patch( + "reposUpdateWebhook", + "/repos/:owner/:repo/hooks/:hookId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposUpdateWebhookParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateWebhookBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdateWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_hook], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteWebhook", + "/repos/:owner/:repo/hooks/:hookId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeleteWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetWebhookConfigForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.get( + "reposGetWebhookConfigForRepo", + "/repos/:owner/:repo/hooks/:hookId/config", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetWebhookConfigForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetWebhookConfigForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_webhook_config]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateWebhookConfigForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), }) - router.post( - "codespacesCreateWithPrForAuthenticatedUser", - "/repos/:owner/:repo/pulls/:pullNumber/codespaces", + const reposUpdateWebhookConfigForRepoBodySchema = z + .object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + }) + .optional() + + router.patch( + "reposUpdateWebhookConfigForRepo", + "/repos/:owner/:repo/hooks/:hookId/config", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesCreateWithPrForAuthenticatedUserParamSchema, + reposUpdateWebhookConfigForRepoParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - codespacesCreateWithPrForAuthenticatedUserBodySchema, + reposUpdateWebhookConfigForRepoBodySchema, ctx.body ), } const { status, body } = - await implementation.codespacesCreateWithPrForAuthenticatedUser( - input, - ctx - ) + await implementation.reposUpdateWebhookConfigForRepo(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "202", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + [["200", s_webhook_config]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListWebhookDeliveriesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + const reposListWebhookDeliveriesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + cursor: z.coerce.string().optional(), + redelivery: z.coerce.boolean().optional(), + }) + + router.get( + "reposListWebhookDeliveries", + "/repos/:owner/:repo/hooks/:hookId/deliveries", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListWebhookDeliveriesParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListWebhookDeliveriesQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.reposListWebhookDeliveries( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), ], + ["400", s_scim_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -90868,34 +48575,326 @@ export function bootstrap( } ) - const pullsListReviewCommentsParamSchema = z.object({ + const reposGetWebhookDeliveryParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), + hook_id: z.coerce.number(), + delivery_id: z.coerce.number(), }) - const pullsListReviewCommentsQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + router.get( + "reposGetWebhookDelivery", + "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetWebhookDeliveryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetWebhookDelivery( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_hook_delivery], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposRedeliverWebhookDeliveryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + delivery_id: z.coerce.number(), + }) + + router.post( + "reposRedeliverWebhookDelivery", + "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId/attempts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposRedeliverWebhookDeliveryParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposRedeliverWebhookDelivery(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposPingWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.post( + "reposPingWebhook", + "/repos/:owner/:repo/hooks/:hookId/pings", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposPingWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposPingWebhook(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposTestPushWebhookParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + hook_id: z.coerce.number(), + }) + + router.post( + "reposTestPushWebhook", + "/repos/:owner/:repo/hooks/:hookId/tests", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposTestPushWebhookParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposTestPushWebhook( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetImportStatusParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.get( - "pullsListReviewComments", - "/repos/:owner/:repo/pulls/:pullNumber/comments", + "migrationsGetImportStatus", + "/repos/:owner/:repo/import", async (ctx, next) => { const input = { params: parseRequestInput( - pullsListReviewCommentsParamSchema, + migrationsGetImportStatusParamSchema, ctx.params ), - query: parseRequestInput(pullsListReviewCommentsQuerySchema, ctx.query), + query: undefined, body: undefined, } - const { status, body } = await implementation.pullsListReviewComments( + const { status, body } = await implementation.migrationsGetImportStatus( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_import], + ["404", s_basic_error], + ["503", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsStartImportParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsStartImportBodySchema = z.object({ + vcs_url: z.coerce.string(), + vcs: z.enum(["subversion", "git", "mercurial", "tfvc"]).optional(), + vcs_username: z.coerce.string().optional(), + vcs_password: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + }) + + router.put( + "migrationsStartImport", + "/repos/:owner/:repo/import", + async (ctx, next) => { + const input = { + params: parseRequestInput(migrationsStartImportParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(migrationsStartImportBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsStartImport( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_import], + ["404", s_basic_error], + ["422", s_validation_error], + ["503", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsUpdateImportParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsUpdateImportBodySchema = z + .object({ + vcs_username: z.coerce.string().optional(), + vcs_password: z.coerce.string().optional(), + vcs: z.enum(["subversion", "tfvc", "git", "mercurial"]).optional(), + tfvc_project: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "migrationsUpdateImport", + "/repos/:owner/:repo/import", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsUpdateImportParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(migrationsUpdateImportBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsUpdateImport( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_import], + ["503", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsCancelImportParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "migrationsCancelImport", + "/repos/:owner/:repo/import", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsCancelImportParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.migrationsCancelImport( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["503", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetCommitAuthorsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const migrationsGetCommitAuthorsQuerySchema = z.object({ + since: z.coerce.number().optional(), + }) + + router.get( + "migrationsGetCommitAuthors", + "/repos/:owner/:repo/import/authors", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsGetCommitAuthorsParamSchema, + ctx.params + ), + query: parseRequestInput( + migrationsGetCommitAuthorsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.migrationsGetCommitAuthors( input, ctx ) @@ -90906,85 +48905,108 @@ export function bootstrap( "200", z.array( z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), + }) + ), + ], + ["404", s_basic_error], + ["503", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsMapCommitAuthorParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + author_id: z.coerce.number(), + }) + + const migrationsMapCommitAuthorBodySchema = z + .object({ + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "migrationsMapCommitAuthor", + "/repos/:owner/:repo/import/authors/:authorId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsMapCommitAuthorParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(migrationsMapCommitAuthorBodySchema, ctx.body), + } + + const { status, body } = await implementation.migrationsMapCommitAuthor( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_porter_author], + ["404", s_basic_error], + ["422", s_validation_error], + ["503", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsGetLargeFilesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "migrationsGetLargeFiles", + "/repos/:owner/:repo/import/large_files", + async (ctx, next) => { + const input = { + params: parseRequestInput( + migrationsGetLargeFilesParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.migrationsGetLargeFiles( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref_name: z.coerce.string(), + path: z.coerce.string(), + oid: z.coerce.string(), + size: z.coerce.number(), }) ), ], + ["503", s_basic_error], ], undefined )(status, body) @@ -90993,157 +49015,38 @@ export function bootstrap( } ) - const pullsCreateReviewCommentParamSchema = z.object({ + const migrationsSetLfsPreferenceParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsCreateReviewCommentBodySchema = z.object({ - body: z.coerce.string(), - commit_id: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number(), - start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT", "side"]).optional(), - in_reply_to: z.coerce.number().optional(), + const migrationsSetLfsPreferenceBodySchema = z.object({ + use_lfs: z.enum(["opt_in", "opt_out"]), }) - router.post( - "pullsCreateReviewComment", - "/repos/:owner/:repo/pulls/:pullNumber/comments", + router.patch( + "migrationsSetLfsPreference", + "/repos/:owner/:repo/import/lfs", async (ctx, next) => { const input = { params: parseRequestInput( - pullsCreateReviewCommentParamSchema, + migrationsSetLfsPreferenceParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(pullsCreateReviewCommentBodySchema, ctx.body), + body: parseRequestInput(migrationsSetLfsPreferenceBodySchema, ctx.body), } - const { status, body } = await implementation.pullsCreateReviewComment( + const { status, body } = await implementation.migrationsSetLfsPreference( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_import], + ["422", s_validation_error], + ["503", s_basic_error], ], undefined )(status, body) @@ -91152,128 +49055,102 @@ export function bootstrap( } ) - const pullsCreateReplyForReviewCommentParamSchema = z.object({ + const appsGetRepoInstallationParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), - comment_id: z.coerce.number(), }) - const pullsCreateReplyForReviewCommentBodySchema = z.object({ - body: z.coerce.string(), + router.get( + "appsGetRepoInstallation", + "/repos/:owner/:repo/installation", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsGetRepoInstallationParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.appsGetRepoInstallation( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_installation], + ["301", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const interactionsGetRestrictionsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.post( - "pullsCreateReplyForReviewComment", - "/repos/:owner/:repo/pulls/:pullNumber/comments/:commentId/replies", + router.get( + "interactionsGetRestrictionsForRepo", + "/repos/:owner/:repo/interaction-limits", async (ctx, next) => { const input = { params: parseRequestInput( - pullsCreateReplyForReviewCommentParamSchema, + interactionsGetRestrictionsForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.interactionsGetRestrictionsForRepo(input, ctx) + + ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const interactionsSetRestrictionsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const interactionsSetRestrictionsForRepoBodySchema = s_interaction_limit + + router.put( + "interactionsSetRestrictionsForRepo", + "/repos/:owner/:repo/interaction-limits", + async (ctx, next) => { + const input = { + params: parseRequestInput( + interactionsSetRestrictionsForRepoParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - pullsCreateReplyForReviewCommentBodySchema, + interactionsSetRestrictionsForRepoBodySchema, ctx.body ), } const { status, body } = - await implementation.pullsCreateReplyForReviewComment(input, ctx) + await implementation.interactionsSetRestrictionsForRepo(input, ctx) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_interaction_limit_response], + ["409", z.void()], ], undefined )(status, body) @@ -91282,28 +49159,63 @@ export function bootstrap( } ) - const pullsListCommitsParamSchema = z.object({ + const interactionsRemoveRestrictionsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsListCommitsQuerySchema = z.object({ + router.delete( + "interactionsRemoveRestrictionsForRepo", + "/repos/:owner/:repo/interaction-limits", + async (ctx, next) => { + const input = { + params: parseRequestInput( + interactionsRemoveRestrictionsForRepoParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListInvitationsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListInvitationsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "pullsListCommits", - "/repos/:owner/:repo/pulls/:pullNumber/commits", + "reposListInvitations", + "/repos/:owner/:repo/invitations", async (ctx, next) => { const input = { - params: parseRequestInput(pullsListCommitsParamSchema, ctx.params), - query: parseRequestInput(pullsListCommitsQuerySchema, ctx.query), + params: parseRequestInput(reposListInvitationsParamSchema, ctx.params), + query: parseRequestInput(reposListInvitationsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.pullsListCommits(input, ctx) + const { status, body } = await implementation.reposListInvitations( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -91311,39 +49223,170 @@ export function bootstrap( "200", z.array( z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - verification: z + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), }) .optional(), }), - author: z.object({ + invitee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -91366,7 +49409,7 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - committer: z.object({ + inviter: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -91389,45 +49432,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), }) ), ], @@ -91439,98 +49455,37 @@ export function bootstrap( } ) - const pullsListFilesParamSchema = z.object({ + const reposUpdateInvitationParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), + invitation_id: z.coerce.number(), }) - const pullsListFilesQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const reposUpdateInvitationBodySchema = z + .object({ + permissions: z + .enum(["read", "write", "maintain", "triage", "admin"]) + .optional(), + }) + .optional() - router.get( - "pullsListFiles", - "/repos/:owner/:repo/pulls/:pullNumber/files", + router.patch( + "reposUpdateInvitation", + "/repos/:owner/:repo/invitations/:invitationId", async (ctx, next) => { const input = { - params: parseRequestInput(pullsListFilesParamSchema, ctx.params), - query: parseRequestInput(pullsListFilesQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(reposUpdateInvitationParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateInvitationBodySchema, ctx.body), } - const { status, body } = await implementation.pullsListFiles(input, ctx) + const { status, body } = await implementation.reposUpdateInvitation( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], + [["200", s_repository_invitation]], undefined )(status, body) ctx.status = status @@ -91538,159 +49493,66 @@ export function bootstrap( } ) - const pullsCheckIfMergedParamSchema = z.object({ + const reposDeleteInvitationParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), + invitation_id: z.coerce.number(), }) - router.get( - "pullsCheckIfMerged", - "/repos/:owner/:repo/pulls/:pullNumber/merge", + router.delete( + "reposDeleteInvitation", + "/repos/:owner/:repo/invitations/:invitationId", async (ctx, next) => { const input = { - params: parseRequestInput(pullsCheckIfMergedParamSchema, ctx.params), + params: parseRequestInput(reposDeleteInvitationParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.pullsCheckIfMerged( + const { status, body } = await implementation.reposDeleteInvitation( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const pullsMergeParamSchema = z.object({ + const issuesListForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), }) - const pullsMergeBodySchema = z - .object({ - commit_title: z.coerce.string().optional(), - commit_message: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - merge_method: z.enum(["merge", "squash", "rebase"]).optional(), - }) - .optional() - - router.put( - "pullsMerge", - "/repos/:owner/:repo/pulls/:pullNumber/merge", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsMergeParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsMergeBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsMerge(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - sha: z.coerce.string(), - merged: z.coerce.boolean(), - message: z.coerce.string(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "405", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsListRequestedReviewersParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), + const issuesListForRepoQuerySchema = z.object({ + milestone: z.coerce.string().optional(), + state: z.enum(["open", "closed", "all"]).optional(), + assignee: z.coerce.string().optional(), + creator: z.coerce.string().optional(), + mentioned: z.coerce.string().optional(), + labels: z.coerce.string().optional(), + sort: z.enum(["created", "updated", "comments"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "pullsListRequestedReviewers", - "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", + "issuesListForRepo", + "/repos/:owner/:repo/issues", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsListRequestedReviewersParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(issuesListForRepoParamSchema, ctx.params), + query: parseRequestInput(issuesListForRepoQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.pullsListRequestedReviewers( + const { status, body } = await implementation.issuesListForRepo( input, ctx ) @@ -91699,9 +49561,24 @@ export function bootstrap( [ [ "200", - z.object({ - users: z.array( - z.object({ + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -91723,151 +49600,22 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - ), - teams: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsRequestReviewersParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsRequestReviewersBodySchema = z - .object({ - reviewers: z.array(z.coerce.string()).optional(), - team_reviewers: z.array(z.coerce.string()).optional(), - }) - .optional() - - router.post( - "pullsRequestReviewers", - "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsRequestReviewersParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsRequestReviewersBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsRequestReviewers( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -91890,45 +49638,44 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -91950,12 +49697,35 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -91978,66 +49748,60 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - requested_teams: z - .array( - z.object({ + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), permissions: z .object({ + admin: z.coerce.boolean(), pull: z.coerce.boolean(), - triage: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -92059,312 +49823,244 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - spdx_id: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -92386,270 +50082,174 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["301", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesCreateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesCreateBodySchema = z.object({ + title: z.union([z.coerce.string(), z.coerce.number()]), + body: z.coerce.string().optional(), + assignee: z.coerce.string().optional(), + milestone: z.union([z.coerce.string(), z.coerce.number()]), + labels: z + .array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + }), + ]) + ) + .optional(), + assignees: z.array(z.coerce.string()).optional(), + }) + + router.post( + "issuesCreate", + "/repos/:owner/:repo/issues", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesCreateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesCreateBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesCreate(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_issue], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesListCommentsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesListCommentsForRepoQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListCommentsForRepo", + "/repos/:owner/:repo/issues/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + issuesListCommentsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.issuesListCommentsForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -92673,29 +50273,241 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesGetCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + router.get( + "issuesGetComment", + "/repos/:owner/:repo/issues/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesGetCommentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesGetComment(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_issue_comment], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesUpdateCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const issuesUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) + + router.patch( + "issuesUpdateComment", + "/repos/:owner/:repo/issues/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesUpdateCommentParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesUpdateCommentBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesUpdateComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_issue_comment], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesDeleteCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + router.delete( + "issuesDeleteComment", + "/repos/:owner/:repo/issues/comments/:commentId", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesDeleteCommentParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesDeleteComment( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reactionsListForIssueCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + }) + + const reactionsListForIssueCommentQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reactionsListForIssueComment", + "/repos/:owner/:repo/issues/comments/:commentId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsListForIssueCommentParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForIssueCommentQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reactionsListForIssueComment(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -92718,23 +50530,21 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - ["422", z.void()], + ["404", s_basic_error], ], undefined )(status, body) @@ -92743,103 +50553,127 @@ export function bootstrap( } ) - const pullsRemoveRequestedReviewersParamSchema = z.object({ + const reactionsCreateForIssueCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), + comment_id: z.coerce.number(), }) - const pullsRemoveRequestedReviewersBodySchema = z.object({ - reviewers: z.array(z.coerce.string()), - team_reviewers: z.array(z.coerce.string()).optional(), + const reactionsCreateForIssueCommentBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) - router.delete( - "pullsRemoveRequestedReviewers", - "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", + router.post( + "reactionsCreateForIssueComment", + "/repos/:owner/:repo/issues/comments/:commentId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - pullsRemoveRequestedReviewersParamSchema, + reactionsCreateForIssueCommentParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - pullsRemoveRequestedReviewersBodySchema, + reactionsCreateForIssueCommentBodySchema, ctx.body ), } const { status, body } = - await implementation.pullsRemoveRequestedReviewers(input, ctx) + await implementation.reactionsCreateForIssueComment(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsDeleteForIssueCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + reaction_id: z.coerce.number(), + }) + + router.delete( + "reactionsDeleteForIssueComment", + "/repos/:owner/:repo/issues/comments/:commentId/reactions/:reactionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsDeleteForIssueCommentParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reactionsDeleteForIssueComment(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const issuesListEventsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesListEventsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListEventsForRepo", + "/repos/:owner/:repo/issues/events", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListEventsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput(issuesListEventsForRepoQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListEventsForRepo( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + url: z.coerce.string(), + actor: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -92862,515 +50696,648 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -93392,845 +51359,159 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsListReviewsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsListReviewsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "pullsListReviews", - "/repos/:owner/:repo/pulls/:pullNumber/reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListReviewsParamSchema, ctx.params), - query: parseRequestInput(pullsListReviewsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.pullsListReviews(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsCreateReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - }) - - const pullsCreateReviewBodySchema = z - .object({ - commit_id: z.coerce.string().optional(), - body: z.coerce.string().optional(), - event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]).optional(), - comments: z - .array( - z.object({ - path: z.coerce.string(), - position: z.coerce.number().optional(), - body: z.coerce.string(), - line: z.coerce.number().optional(), - side: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - start_side: z.coerce.string().optional(), - }) - ) - .optional(), - }) - .optional() - - router.post( - "pullsCreateReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsCreateReviewParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsCreateReviewBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsCreateReview( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsGetReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - router.get( - "pullsGetReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsGetReviewParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.pullsGetReview(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsUpdateReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - const pullsUpdateReviewBodySchema = z.object({ body: z.coerce.string() }) - - router.put( - "pullsUpdateReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", - async (ctx, next) => { - const input = { - params: parseRequestInput(pullsUpdateReviewParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(pullsUpdateReviewBodySchema, ctx.body), - } - - const { status, body } = await implementation.pullsUpdateReview( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const pullsDeletePendingReviewParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - router.delete( - "pullsDeletePendingReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - pullsDeletePendingReviewParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.pullsDeletePendingReview( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), ], + ["422", s_validation_error], ], undefined )(status, body) @@ -94239,133 +51520,30 @@ export function bootstrap( } ) - const pullsListCommentsForReviewParamSchema = z.object({ + const issuesGetEventParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - const pullsListCommentsForReviewQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + event_id: z.coerce.number(), }) router.get( - "pullsListCommentsForReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/comments", + "issuesGetEvent", + "/repos/:owner/:repo/issues/events/:eventId", async (ctx, next) => { const input = { - params: parseRequestInput( - pullsListCommentsForReviewParamSchema, - ctx.params - ), - query: parseRequestInput( - pullsListCommentsForReviewQuerySchema, - ctx.query - ), + params: parseRequestInput(issuesGetEventParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.pullsListCommentsForReview( - input, - ctx - ) + const { status, body } = await implementation.issuesGetEvent(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_issue_event], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], ], undefined )(status, body) @@ -94374,107 +51552,31 @@ export function bootstrap( } ) - const pullsDismissReviewParamSchema = z.object({ + const issuesGetParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), - }) - - const pullsDismissReviewBodySchema = z.object({ - message: z.coerce.string(), - event: z.enum(["DISMISS"]).optional(), + issue_number: z.coerce.number(), }) - router.put( - "pullsDismissReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/dismissals", + router.get( + "issuesGet", + "/repos/:owner/:repo/issues/:issueNumber", async (ctx, next) => { const input = { - params: parseRequestInput(pullsDismissReviewParamSchema, ctx.params), + params: parseRequestInput(issuesGetParamSchema, ctx.params), query: undefined, - body: parseRequestInput(pullsDismissReviewBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.pullsDismissReview( - input, - ctx - ) + const { status, body } = await implementation.issuesGet(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["200", s_issue], + ["301", s_basic_error], + ["304", z.void()], + ["404", s_basic_error], + ["410", s_basic_error], ], undefined )(status, body) @@ -94483,114 +51585,63 @@ export function bootstrap( } ) - const pullsSubmitReviewParamSchema = z.object({ + const issuesUpdateParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), - review_id: z.coerce.number(), + issue_number: z.coerce.number(), }) - const pullsSubmitReviewBodySchema = z.object({ - body: z.coerce.string().optional(), - event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), - }) + const issuesUpdateBodySchema = z + .object({ + title: z.union([z.coerce.string(), z.coerce.number()]), + body: z.coerce.string().optional(), + assignee: z.coerce.string().optional(), + state: z.enum(["open", "closed"]).optional(), + state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), + milestone: z.union([z.coerce.string(), z.coerce.number()]), + labels: z + .array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + }), + ]) + ) + .optional(), + assignees: z.array(z.coerce.string()).optional(), + }) + .optional() - router.post( - "pullsSubmitReview", - "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/events", + router.patch( + "issuesUpdate", + "/repos/:owner/:repo/issues/:issueNumber", async (ctx, next) => { const input = { - params: parseRequestInput(pullsSubmitReviewParamSchema, ctx.params), + params: parseRequestInput(issuesUpdateParamSchema, ctx.params), query: undefined, - body: parseRequestInput(pullsSubmitReviewBodySchema, ctx.body), + body: parseRequestInput(issuesUpdateBodySchema, ctx.body), } - const { status, body } = await implementation.pullsSubmitReview( - input, - ctx - ) + const { status, body } = await implementation.issuesUpdate(input, ctx) ctx.body = responseValidationFactory( [ + ["200", s_issue], + ["301", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), }), ], ], @@ -94601,254 +51652,101 @@ export function bootstrap( } ) - const pullsUpdateBranchParamSchema = z.object({ + const issuesAddAssigneesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - pull_number: z.coerce.number(), + issue_number: z.coerce.number(), }) - const pullsUpdateBranchBodySchema = z - .object({ expected_head_sha: z.coerce.string().optional() }) + const issuesAddAssigneesBodySchema = z + .object({ assignees: z.array(z.coerce.string()).optional() }) .optional() - router.put( - "pullsUpdateBranch", - "/repos/:owner/:repo/pulls/:pullNumber/update-branch", + router.post( + "issuesAddAssignees", + "/repos/:owner/:repo/issues/:issueNumber/assignees", async (ctx, next) => { const input = { - params: parseRequestInput(pullsUpdateBranchParamSchema, ctx.params), + params: parseRequestInput(issuesAddAssigneesParamSchema, ctx.params), query: undefined, - body: parseRequestInput(pullsUpdateBranchBodySchema, ctx.body), + body: parseRequestInput(issuesAddAssigneesBodySchema, ctx.body), } - const { status, body } = await implementation.pullsUpdateBranch( + const { status, body } = await implementation.issuesAddAssignees( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "202", - z.object({ - message: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["201", s_issue]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetReadmeParamSchema = z.object({ + const issuesRemoveAssigneesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), }) - const reposGetReadmeQuerySchema = z.object({ - ref: z.coerce.string().optional(), + const issuesRemoveAssigneesBodySchema = z.object({ + assignees: z.array(z.coerce.string()).optional(), }) - router.get( - "reposGetReadme", - "/repos/:owner/:repo/readme", + router.delete( + "issuesRemoveAssignees", + "/repos/:owner/:repo/issues/:issueNumber/assignees", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetReadmeParamSchema, ctx.params), - query: parseRequestInput(reposGetReadmeQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(issuesRemoveAssigneesParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesRemoveAssigneesBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetReadme(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - type: z.enum(["file"]), - encoding: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - target: z.coerce.string().optional(), - submodule_git_url: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + const { status, body } = await implementation.issuesRemoveAssignees( + input, + ctx + ) + + ctx.body = responseValidationFactory([["200", s_issue]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetReadmeInDirectoryParamSchema = z.object({ + const issuesCheckUserCanBeAssignedToIssueParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - dir: z.coerce.string(), - }) - - const reposGetReadmeInDirectoryQuerySchema = z.object({ - ref: z.coerce.string().optional(), + issue_number: z.coerce.number(), + assignee: z.coerce.string(), }) router.get( - "reposGetReadmeInDirectory", - "/repos/:owner/:repo/readme/:dir", + "issuesCheckUserCanBeAssignedToIssue", + "/repos/:owner/:repo/issues/:issueNumber/assignees/:assignee", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetReadmeInDirectoryParamSchema, + issuesCheckUserCanBeAssignedToIssueParamSchema, ctx.params ), - query: parseRequestInput( - reposGetReadmeInDirectoryQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetReadmeInDirectory( - input, - ctx - ) + const { status, body } = + await implementation.issuesCheckUserCanBeAssignedToIssue(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - type: z.enum(["file"]), - encoding: z.coerce.string(), - size: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - download_url: z.coerce.string(), - _links: z.object({ - git: z.coerce.string(), - html: z.coerce.string(), - self: z.coerce.string(), - }), - target: z.coerce.string().optional(), - submodule_git_url: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["204", z.void()], + ["404", s_basic_error], ], undefined )(status, body) @@ -94857,27 +51755,29 @@ export function bootstrap( } ) - const reposListReleasesParamSchema = z.object({ + const issuesListCommentsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), }) - const reposListReleasesQuerySchema = z.object({ + const issuesListCommentsQuerySchema = z.object({ + since: z.coerce.string().datetime({ offset: true }).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "reposListReleases", - "/repos/:owner/:repo/releases", + "issuesListComments", + "/repos/:owner/:repo/issues/:issueNumber/comments", async (ctx, next) => { const input = { - params: parseRequestInput(reposListReleasesParamSchema, ctx.params), - query: parseRequestInput(reposListReleasesQuerySchema, ctx.query), + params: parseRequestInput(issuesListCommentsParamSchema, ctx.params), + query: parseRequestInput(issuesListCommentsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposListReleases( + const { status, body } = await implementation.issuesListComments( input, ctx ) @@ -94888,23 +51788,14 @@ export function bootstrap( "200", z.array( z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), + url: z.coerce.string(), body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -94927,21 +51818,25 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -94964,462 +51859,84 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), + .optional(), reactions: z .object({ url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposCreateReleaseParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposCreateReleaseBodySchema = z.object({ - tag_name: z.coerce.string(), - target_commitish: z.coerce.string().optional(), - name: z.coerce.string().optional(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean().optional(), - prerelease: z.coerce.boolean().optional(), - discussion_category_name: z.coerce.string().optional(), - generate_release_notes: z.coerce.boolean().optional(), - make_latest: z.enum(["true", "false", "legacy"]).optional(), - }) - - router.post( - "reposCreateRelease", - "/repos/:owner/:repo/releases", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposCreateReleaseParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposCreateReleaseBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateRelease( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetReleaseAssetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - asset_id: z.coerce.number(), - }) - - router.get( - "reposGetReleaseAsset", - "/repos/:owner/:repo/releases/assets/:assetId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetReleaseAssetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposGetReleaseAsset( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - ], - ["302", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposUpdateReleaseAssetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - asset_id: z.coerce.number(), - }) - - const reposUpdateReleaseAssetBodySchema = z - .object({ - name: z.coerce.string().optional(), - label: z.coerce.string().optional(), - state: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "reposUpdateReleaseAsset", - "/repos/:owner/:repo/releases/assets/:assetId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposUpdateReleaseAssetParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposUpdateReleaseAssetBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdateReleaseAsset( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposDeleteReleaseAssetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - asset_id: z.coerce.number(), - }) - - router.delete( - "reposDeleteReleaseAsset", - "/repos/:owner/:repo/releases/assets/:assetId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposDeleteReleaseAssetParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.reposDeleteReleaseAsset( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposGenerateReleaseNotesParamSchema = z.object({ + const issuesCreateCommentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), }) - const reposGenerateReleaseNotesBodySchema = z.object({ - tag_name: z.coerce.string(), - target_commitish: z.coerce.string().optional(), - previous_tag_name: z.coerce.string().optional(), - configuration_file_path: z.coerce.string().optional(), - }) + const issuesCreateCommentBodySchema = z.object({ body: z.coerce.string() }) router.post( - "reposGenerateReleaseNotes", - "/repos/:owner/:repo/releases/generate-notes", + "issuesCreateComment", + "/repos/:owner/:repo/issues/:issueNumber/comments", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGenerateReleaseNotesParamSchema, - ctx.params - ), + params: parseRequestInput(issuesCreateCommentParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposGenerateReleaseNotesBodySchema, ctx.body), + body: parseRequestInput(issuesCreateCommentBodySchema, ctx.body), } - const { status, body } = await implementation.reposGenerateReleaseNotes( + const { status, body } = await implementation.issuesCreateComment( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ name: z.coerce.string(), body: z.coerce.string() }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["201", s_issue_comment], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -95428,129 +51945,33 @@ export function bootstrap( } ) - const reposGetLatestReleaseParamSchema = z.object({ + const issuesListEventsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesListEventsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetLatestRelease", - "/repos/:owner/:repo/releases/latest", + "issuesListEvents", + "/repos/:owner/:repo/issues/:issueNumber/events", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetLatestReleaseParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(issuesListEventsParamSchema, ctx.params), + query: parseRequestInput(issuesListEventsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposGetLatestRelease( - input, - ctx - ) + const { status, body } = await implementation.issuesListEvents(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], + ["200", z.array(z.object({}))], + ["410", s_basic_error], ], undefined )(status, body) @@ -95559,23 +51980,31 @@ export function bootstrap( } ) - const reposGetReleaseByTagParamSchema = z.object({ + const issuesListLabelsOnIssueParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - tag: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesListLabelsOnIssueQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "reposGetReleaseByTag", - "/repos/:owner/:repo/releases/tags/:tag", + "issuesListLabelsOnIssue", + "/repos/:owner/:repo/issues/:issueNumber/labels", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetReleaseByTagParamSchema, ctx.params), - query: undefined, + params: parseRequestInput( + issuesListLabelsOnIssueParamSchema, + ctx.params + ), + query: parseRequestInput(issuesListLabelsOnIssueQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposGetReleaseByTag( + const { status, body } = await implementation.issuesListLabelsOnIssue( input, ctx ) @@ -95584,114 +52013,21 @@ export function bootstrap( [ [ "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], ], undefined )(status, body) @@ -95700,136 +52036,54 @@ export function bootstrap( } ) - const reposGetReleaseParamSchema = z.object({ + const issuesAddLabelsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + issue_number: z.coerce.number(), }) - router.get( - "reposGetRelease", - "/repos/:owner/:repo/releases/:releaseId", + const issuesAddLabelsBodySchema = z.union([ + z.object({ labels: z.array(z.coerce.string()).optional() }), + z.array(z.coerce.string()), + z.object({ + labels: z.array(z.object({ name: z.coerce.string() })).optional(), + }), + z.array(z.object({ name: z.coerce.string() })), + z.coerce.string(), + ]) + + router.post( + "issuesAddLabels", + "/repos/:owner/:repo/issues/:issueNumber/labels", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetReleaseParamSchema, ctx.params), + params: parseRequestInput(issuesAddLabelsParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(issuesAddLabelsBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetRelease(input, ctx) + const { status, body } = await implementation.issuesAddLabels(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -95838,152 +52092,54 @@ export function bootstrap( } ) - const reposUpdateReleaseParamSchema = z.object({ + const issuesSetLabelsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + issue_number: z.coerce.number(), }) - const reposUpdateReleaseBodySchema = z - .object({ - tag_name: z.coerce.string().optional(), - target_commitish: z.coerce.string().optional(), - name: z.coerce.string().optional(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean().optional(), - prerelease: z.coerce.boolean().optional(), - make_latest: z.enum(["true", "false", "legacy"]).optional(), - discussion_category_name: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "reposUpdateRelease", - "/repos/:owner/:repo/releases/:releaseId", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposUpdateReleaseParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(reposUpdateReleaseBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposUpdateRelease( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], + const issuesSetLabelsBodySchema = z.union([ + z.object({ labels: z.array(z.coerce.string()).optional() }), + z.array(z.coerce.string()), + z.object({ + labels: z.array(z.object({ name: z.coerce.string() })).optional(), + }), + z.array(z.object({ name: z.coerce.string() })), + z.coerce.string(), + ]) + + router.put( + "issuesSetLabels", + "/repos/:owner/:repo/issues/:issueNumber/labels", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesSetLabelsParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesSetLabelsBodySchema, ctx.body), + } + + const { status, body } = await implementation.issuesSetLabels(input, ctx) + + ctx.body = responseValidationFactory( + [ [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -95992,61 +52148,59 @@ export function bootstrap( } ) - const reposDeleteReleaseParamSchema = z.object({ + const issuesRemoveAllLabelsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + issue_number: z.coerce.number(), }) router.delete( - "reposDeleteRelease", - "/repos/:owner/:repo/releases/:releaseId", + "issuesRemoveAllLabels", + "/repos/:owner/:repo/issues/:issueNumber/labels", async (ctx, next) => { const input = { - params: parseRequestInput(reposDeleteReleaseParamSchema, ctx.params), + params: parseRequestInput(issuesRemoveAllLabelsParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposDeleteRelease( + const { status, body } = await implementation.issuesRemoveAllLabels( input, ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListReleaseAssetsParamSchema = z.object({ + const issuesRemoveLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), - }) - - const reposListReleaseAssetsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + issue_number: z.coerce.number(), + name: z.coerce.string(), }) - router.get( - "reposListReleaseAssets", - "/repos/:owner/:repo/releases/:releaseId/assets", + router.delete( + "issuesRemoveLabel", + "/repos/:owner/:repo/issues/:issueNumber/labels/:name", async (ctx, next) => { const input = { - params: parseRequestInput( - reposListReleaseAssetsParamSchema, - ctx.params - ), - query: parseRequestInput(reposListReleaseAssetsQuerySchema, ctx.query), + params: parseRequestInput(issuesRemoveLabelParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListReleaseAssets( + const { status, body } = await implementation.issuesRemoveLabel( input, ctx ) @@ -96057,44 +52211,19 @@ export function bootstrap( "200", z.array( z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), }) ), ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], ], undefined )(status, body) @@ -96103,80 +52232,70 @@ export function bootstrap( } ) - const reposUploadReleaseAssetParamSchema = z.object({ + const issuesLockParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + issue_number: z.coerce.number(), }) - const reposUploadReleaseAssetQuerySchema = z.object({ - name: z.coerce.string(), - label: z.coerce.string().optional(), - }) + const issuesLockBodySchema = z + .object({ + lock_reason: z + .enum(["off-topic", "too heated", "resolved", "spam"]) + .optional(), + }) + .optional() - const reposUploadReleaseAssetBodySchema = z.coerce.string().optional() + router.put( + "issuesLock", + "/repos/:owner/:repo/issues/:issueNumber/lock", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesLockParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesLockBodySchema, ctx.body), + } - router.post( - "reposUploadReleaseAsset", - "/repos/:owner/:repo/releases/:releaseId/assets", + const { status, body } = await implementation.issuesLock(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const issuesUnlockParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + router.delete( + "issuesUnlock", + "/repos/:owner/:repo/issues/:issueNumber/lock", async (ctx, next) => { const input = { - params: parseRequestInput( - reposUploadReleaseAssetParamSchema, - ctx.params - ), - query: parseRequestInput(reposUploadReleaseAssetQuerySchema, ctx.query), - body: parseRequestInput(reposUploadReleaseAssetBodySchema, ctx.body), + params: parseRequestInput(issuesUnlockParamSchema, ctx.params), + query: undefined, + body: undefined, } - const { status, body } = await implementation.reposUploadReleaseAsset( - input, - ctx - ) + const { status, body } = await implementation.issuesUnlock(input, ctx) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - ], - ["422", z.void()], + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -96185,34 +52304,40 @@ export function bootstrap( } ) - const reactionsListForReleaseParamSchema = z.object({ + const reactionsListForIssueParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + issue_number: z.coerce.number(), }) - const reactionsListForReleaseQuerySchema = z.object({ + const reactionsListForIssueQuerySchema = z.object({ content: z - .enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]) + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) .optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "reactionsListForRelease", - "/repos/:owner/:repo/releases/:releaseId/reactions", + "reactionsListForIssue", + "/repos/:owner/:repo/issues/:issueNumber/reactions", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsListForReleaseParamSchema, - ctx.params - ), - query: parseRequestInput(reactionsListForReleaseQuerySchema, ctx.query), + params: parseRequestInput(reactionsListForIssueParamSchema, ctx.params), + query: parseRequestInput(reactionsListForIssueQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reactionsListForRelease( + const { status, body } = await implementation.reactionsListForIssue( input, ctx ) @@ -96262,15 +52387,8 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], + ["410", s_basic_error], ], undefined )(status, body) @@ -96279,30 +52397,156 @@ export function bootstrap( } ) - const reactionsCreateForReleaseParamSchema = z.object({ + const reactionsCreateForIssueParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), + issue_number: z.coerce.number(), }) - const reactionsCreateForReleaseBodySchema = z.object({ - content: z.enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]), + const reactionsCreateForIssueBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) router.post( - "reactionsCreateForRelease", - "/repos/:owner/:repo/releases/:releaseId/reactions", + "reactionsCreateForIssue", + "/repos/:owner/:repo/issues/:issueNumber/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsCreateForReleaseParamSchema, + reactionsCreateForIssueParamSchema, ctx.params ), query: undefined, - body: parseRequestInput(reactionsCreateForReleaseBodySchema, ctx.body), + body: parseRequestInput(reactionsCreateForIssueBodySchema, ctx.body), } - const { status, body } = await implementation.reactionsCreateForRelease( + const { status, body } = await implementation.reactionsCreateForIssue( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsDeleteForIssueParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + reaction_id: z.coerce.number(), + }) + + router.delete( + "reactionsDeleteForIssue", + "/repos/:owner/:repo/issues/:issueNumber/reactions/:reactionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsDeleteForIssueParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reactionsDeleteForIssue( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const issuesListEventsForTimelineParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesListEventsForTimelineQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "issuesListEventsForTimeline", + "/repos/:owner/:repo/issues/:issueNumber/timeline", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListEventsForTimelineParamSchema, + ctx.params + ), + query: parseRequestInput( + issuesListEventsForTimelineQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.issuesListEventsForTimeline( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.array(z.object({}))], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListDeployKeysParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListDeployKeysQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListDeployKeys", + "/repos/:owner/:repo/keys", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListDeployKeysParamSchema, ctx.params), + query: parseRequestInput(reposListDeployKeysQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListDeployKeys( input, ctx ) @@ -96311,108 +52555,19 @@ export function bootstrap( [ [ "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + z.array( + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + key: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }) + ), ], ], undefined @@ -96422,207 +52577,131 @@ export function bootstrap( } ) - const reactionsDeleteForReleaseParamSchema = z.object({ + const reposCreateDeployKeyParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposCreateDeployKeyBodySchema = z.object({ + title: z.coerce.string().optional(), + key: z.coerce.string(), + read_only: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateDeployKey", + "/repos/:owner/:repo/keys", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateDeployKeyParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateDeployKeyBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateDeployKey( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_deploy_key], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetDeployKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - release_id: z.coerce.number(), - reaction_id: z.coerce.number(), + key_id: z.coerce.number(), }) - router.delete( - "reactionsDeleteForRelease", - "/repos/:owner/:repo/releases/:releaseId/reactions/:reactionId", + router.get( + "reposGetDeployKey", + "/repos/:owner/:repo/keys/:keyId", async (ctx, next) => { const input = { - params: parseRequestInput( - reactionsDeleteForReleaseParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetDeployKeyParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reactionsDeleteForRelease( + const { status, body } = await implementation.reposGetDeployKey( input, ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["200", s_deploy_key], + ["404", s_basic_error], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const secretScanningListAlertsForRepoParamSchema = z.object({ + const reposDeleteDeployKeyParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + key_id: z.coerce.number(), }) - const secretScanningListAlertsForRepoQuerySchema = z.object({ - state: z.enum(["open", "resolved"]).optional(), - secret_type: z.coerce.string().optional(), - resolution: z.coerce.string().optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - }) - - router.get( - "secretScanningListAlertsForRepo", - "/repos/:owner/:repo/secret-scanning/alerts", + router.delete( + "reposDeleteDeployKey", + "/repos/:owner/:repo/keys/:keyId", async (ctx, next) => { const input = { - params: parseRequestInput( - secretScanningListAlertsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListAlertsForRepoQuerySchema, - ctx.query - ), + params: parseRequestInput(reposDeleteDeployKeyParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = - await implementation.secretScanningListAlertsForRepo(input, ctx) + const { status, body } = await implementation.reposDeleteDeployKey( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - ], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const secretScanningGetAlertParamSchema = z.object({ + const issuesListLabelsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - alert_number: z.coerce.number(), + }) + + const issuesListLabelsForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "secretScanningGetAlert", - "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", + "issuesListLabelsForRepo", + "/repos/:owner/:repo/labels", async (ctx, next) => { const input = { params: parseRequestInput( - secretScanningGetAlertParamSchema, + issuesListLabelsForRepoParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput(issuesListLabelsForRepoQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.secretScanningGetAlert( + const { status, body } = await implementation.issuesListLabelsForRepo( input, ctx ) @@ -96631,104 +52710,19 @@ export function bootstrap( [ [ "200", - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }), - ], - ["304", z.void()], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -96737,141 +52731,37 @@ export function bootstrap( } ) - const secretScanningUpdateAlertParamSchema = z.object({ + const issuesCreateLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - alert_number: z.coerce.number(), }) - const secretScanningUpdateAlertBodySchema = z.object({ - state: z.enum(["open", "resolved"]), - resolution: z - .enum(["null", "false_positive", "wont_fix", "revoked", "used_in_tests"]) - .optional(), - resolution_comment: z.coerce.string().optional(), + const issuesCreateLabelBodySchema = z.object({ + name: z.coerce.string(), + color: z.coerce.string().optional(), + description: z.coerce.string().optional(), }) - router.patch( - "secretScanningUpdateAlert", - "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", + router.post( + "issuesCreateLabel", + "/repos/:owner/:repo/labels", async (ctx, next) => { const input = { - params: parseRequestInput( - secretScanningUpdateAlertParamSchema, - ctx.params - ), + params: parseRequestInput(issuesCreateLabelParamSchema, ctx.params), query: undefined, - body: parseRequestInput(secretScanningUpdateAlertBodySchema, ctx.body), + body: parseRequestInput(issuesCreateLabelBodySchema, ctx.body), } - const { status, body } = await implementation.secretScanningUpdateAlert( + const { status, body } = await implementation.issuesCreateLabel( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }), - ], - ["400", z.void()], - ["404", z.void()], - ["422", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + ["201", s_label], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -96880,76 +52770,28 @@ export function bootstrap( } ) - const secretScanningListLocationsForAlertParamSchema = z.object({ + const issuesGetLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - alert_number: z.coerce.number(), - }) - - const secretScanningListLocationsForAlertQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), + name: z.coerce.string(), }) router.get( - "secretScanningListLocationsForAlert", - "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber/locations", + "issuesGetLabel", + "/repos/:owner/:repo/labels/:name", async (ctx, next) => { const input = { - params: parseRequestInput( - secretScanningListLocationsForAlertParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListLocationsForAlertQuerySchema, - ctx.query - ), + params: parseRequestInput(issuesGetLabelParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = - await implementation.secretScanningListLocationsForAlert(input, ctx) + const { status, body } = await implementation.issuesGetLabel(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - type: z.enum([ - "commit", - "issue_title", - "issue_body", - "issue_comment", - ]), - details: z.union([ - z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number(), - end_column: z.coerce.number(), - blob_sha: z.coerce.string(), - blob_url: z.coerce.string(), - commit_sha: z.coerce.string(), - commit_url: z.coerce.string(), - }), - z.object({ issue_title_url: z.coerce.string() }), - z.object({ issue_body_url: z.coerce.string() }), - z.object({ issue_comment_url: z.coerce.string() }), - ]), - }) - ), - ], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + ["200", s_label], + ["404", s_basic_error], ], undefined )(status, body) @@ -96958,216 +52800,127 @@ export function bootstrap( } ) - const activityListStargazersForRepoParamSchema = z.object({ + const issuesUpdateLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + name: z.coerce.string(), }) - const activityListStargazersForRepoQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + const issuesUpdateLabelBodySchema = z + .object({ + new_name: z.coerce.string().optional(), + color: z.coerce.string().optional(), + description: z.coerce.string().optional(), + }) + .optional() - router.get( - "activityListStargazersForRepo", - "/repos/:owner/:repo/stargazers", + router.patch( + "issuesUpdateLabel", + "/repos/:owner/:repo/labels/:name", async (ctx, next) => { const input = { - params: parseRequestInput( - activityListStargazersForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListStargazersForRepoQuerySchema, - ctx.query - ), - body: undefined, + params: parseRequestInput(issuesUpdateLabelParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(issuesUpdateLabelBodySchema, ctx.body), } - - const { status, body } = - await implementation.activityListStargazersForRepo(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", z.object({})], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + + const { status, body } = await implementation.issuesUpdateLabel( + input, + ctx + ) + + ctx.body = responseValidationFactory([["200", s_label]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetCodeFrequencyStatsParamSchema = z.object({ + const issuesDeleteLabelParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + name: z.coerce.string(), }) - router.get( - "reposGetCodeFrequencyStats", - "/repos/:owner/:repo/stats/code_frequency", + router.delete( + "issuesDeleteLabel", + "/repos/:owner/:repo/labels/:name", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetCodeFrequencyStatsParamSchema, - ctx.params - ), + params: parseRequestInput(issuesDeleteLabelParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetCodeFrequencyStats( + const { status, body } = await implementation.issuesDeleteLabel( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.array(z.coerce.number()))], - ["202", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetCommitActivityStatsParamSchema = z.object({ + const reposListLanguagesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) router.get( - "reposGetCommitActivityStats", - "/repos/:owner/:repo/stats/commit_activity", + "reposListLanguages", + "/repos/:owner/:repo/languages", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetCommitActivityStatsParamSchema, - ctx.params - ), + params: parseRequestInput(reposListLanguagesParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetCommitActivityStats( + const { status, body } = await implementation.reposListLanguages( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - days: z.array(z.coerce.number()), - total: z.coerce.number(), - week: z.coerce.number(), - }) - ), - ], - ["202", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_language]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetContributorsStatsParamSchema = z.object({ + const reposEnableLfsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.get( - "reposGetContributorsStats", - "/repos/:owner/:repo/stats/contributors", + router.put( + "reposEnableLfsForRepo", + "/repos/:owner/:repo/lfs", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetContributorsStatsParamSchema, - ctx.params - ), + params: parseRequestInput(reposEnableLfsForRepoParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetContributorsStats( + const { status, body } = await implementation.reposEnableLfsForRepo( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - total: z.coerce.number(), - weeks: z.array( - z.object({ - w: z.coerce.number().optional(), - a: z.coerce.number().optional(), - d: z.coerce.number().optional(), - c: z.coerce.number().optional(), - }) - ), - }) - ), - ], ["202", z.object({})], - ["204", z.void()], + ["403", z.void()], ], undefined )(status, body) @@ -97176,83 +52929,60 @@ export function bootstrap( } ) - const reposGetParticipationStatsParamSchema = z.object({ + const reposDisableLfsForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.get( - "reposGetParticipationStats", - "/repos/:owner/:repo/stats/participation", + router.delete( + "reposDisableLfsForRepo", + "/repos/:owner/:repo/lfs", async (ctx, next) => { const input = { params: parseRequestInput( - reposGetParticipationStatsParamSchema, + reposDisableLfsForRepoParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetParticipationStats( + const { status, body } = await implementation.reposDisableLfsForRepo( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - all: z.array(z.coerce.number()), - owner: z.array(z.coerce.number()), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposGetPunchCardStatsParamSchema = z.object({ + const licensesGetForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) router.get( - "reposGetPunchCardStats", - "/repos/:owner/:repo/stats/punch_card", + "licensesGetForRepo", + "/repos/:owner/:repo/license", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetPunchCardStatsParamSchema, - ctx.params - ), + params: parseRequestInput(licensesGetForRepoParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetPunchCardStats( + const { status, body } = await implementation.licensesGetForRepo( input, ctx ) ctx.body = responseValidationFactory( - [ - ["200", z.array(z.array(z.coerce.number()))], - ["204", z.void()], - ], + [["200", s_license_content]], undefined )(status, body) ctx.status = status @@ -97260,77 +52990,33 @@ export function bootstrap( } ) - const reposCreateCommitStatusParamSchema = z.object({ + const reposMergeUpstreamParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - sha: z.coerce.string(), }) - const reposCreateCommitStatusBodySchema = z.object({ - state: z.enum(["error", "failure", "pending", "success"]), - target_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - context: z.coerce.string().optional(), - }) + const reposMergeUpstreamBodySchema = z.object({ branch: z.coerce.string() }) router.post( - "reposCreateCommitStatus", - "/repos/:owner/:repo/statuses/:sha", + "reposMergeUpstream", + "/repos/:owner/:repo/merge-upstream", async (ctx, next) => { const input = { - params: parseRequestInput( - reposCreateCommitStatusParamSchema, - ctx.params - ), + params: parseRequestInput(reposMergeUpstreamParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposCreateCommitStatusBodySchema, ctx.body), + body: parseRequestInput(reposMergeUpstreamBodySchema, ctx.body), } - const { status, body } = await implementation.reposCreateCommitStatus( + const { status, body } = await implementation.reposMergeUpstream( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - url: z.coerce.string(), - avatar_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.coerce.string(), - description: z.coerce.string(), - target_url: z.coerce.string(), - context: z.coerce.string(), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - ], + ["200", s_merged_upstream], + ["409", z.void()], + ["422", z.void()], ], undefined )(status, body) @@ -97339,33 +53025,65 @@ export function bootstrap( } ) - const activityListWatchersForRepoParamSchema = z.object({ + const reposMergeParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const activityListWatchersForRepoQuerySchema = z.object({ + const reposMergeBodySchema = z.object({ + base: z.coerce.string(), + head: z.coerce.string(), + commit_message: z.coerce.string().optional(), + }) + + router.post("reposMerge", "/repos/:owner/:repo/merges", async (ctx, next) => { + const input = { + params: parseRequestInput(reposMergeParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposMergeBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposMerge(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_commit], + ["204", z.void()], + ["403", s_basic_error], + ["404", z.void()], + ["409", z.void()], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const issuesListMilestonesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesListMilestonesQuerySchema = z.object({ + state: z.enum(["open", "closed", "all"]).optional(), + sort: z.enum(["due_on", "completeness"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "activityListWatchersForRepo", - "/repos/:owner/:repo/subscribers", + "issuesListMilestones", + "/repos/:owner/:repo/milestones", async (ctx, next) => { const input = { - params: parseRequestInput( - activityListWatchersForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListWatchersForRepoQuerySchema, - ctx.query - ), + params: parseRequestInput(issuesListMilestonesParamSchema, ctx.params), + query: parseRequestInput(issuesListMilestonesQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.activityListWatchersForRepo( + const { status, body } = await implementation.issuesListMilestones( input, ctx ) @@ -97376,30 +53094,48 @@ export function bootstrap( "200", z.array( z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), }) ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -97408,52 +53144,38 @@ export function bootstrap( } ) - const activityGetRepoSubscriptionParamSchema = z.object({ + const issuesCreateMilestoneParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.get( - "activityGetRepoSubscription", - "/repos/:owner/:repo/subscription", + const issuesCreateMilestoneBodySchema = z.object({ + title: z.coerce.string(), + state: z.enum(["open", "closed"]).optional(), + description: z.coerce.string().optional(), + due_on: z.coerce.string().datetime({ offset: true }).optional(), + }) + + router.post( + "issuesCreateMilestone", + "/repos/:owner/:repo/milestones", async (ctx, next) => { const input = { - params: parseRequestInput( - activityGetRepoSubscriptionParamSchema, - ctx.params - ), + params: parseRequestInput(issuesCreateMilestoneParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(issuesCreateMilestoneBodySchema, ctx.body), } - const { status, body } = await implementation.activityGetRepoSubscription( + const { status, body } = await implementation.issuesCreateMilestone( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - repository_url: z.coerce.string(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["404", z.void()], + ["201", s_milestone], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -97462,52 +53184,31 @@ export function bootstrap( } ) - const activitySetRepoSubscriptionParamSchema = z.object({ + const issuesGetMilestoneParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + milestone_number: z.coerce.number(), }) - const activitySetRepoSubscriptionBodySchema = z - .object({ - subscribed: z.coerce.boolean().optional(), - ignored: z.coerce.boolean().optional(), - }) - .optional() - - router.put( - "activitySetRepoSubscription", - "/repos/:owner/:repo/subscription", + router.get( + "issuesGetMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber", async (ctx, next) => { const input = { - params: parseRequestInput( - activitySetRepoSubscriptionParamSchema, - ctx.params - ), + params: parseRequestInput(issuesGetMilestoneParamSchema, ctx.params), query: undefined, - body: parseRequestInput( - activitySetRepoSubscriptionBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = await implementation.activitySetRepoSubscription( + const { status, body } = await implementation.issuesGetMilestone( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - subscribed: z.coerce.boolean(), - ignored: z.coerce.boolean(), - reason: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - repository_url: z.coerce.string(), - }), - ], + ["200", s_milestone], + ["404", s_basic_error], ], undefined )(status, body) @@ -97516,28 +53217,37 @@ export function bootstrap( } ) - const activityDeleteRepoSubscriptionParamSchema = z.object({ + const issuesUpdateMilestoneParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + milestone_number: z.coerce.number(), }) - router.delete( - "activityDeleteRepoSubscription", - "/repos/:owner/:repo/subscription", + const issuesUpdateMilestoneBodySchema = z + .object({ + title: z.coerce.string().optional(), + state: z.enum(["open", "closed"]).optional(), + description: z.coerce.string().optional(), + due_on: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional() + + router.patch( + "issuesUpdateMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber", async (ctx, next) => { const input = { - params: parseRequestInput( - activityDeleteRepoSubscriptionParamSchema, - ctx.params - ), + params: parseRequestInput(issuesUpdateMilestoneParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(issuesUpdateMilestoneBodySchema, ctx.body), } - const { status, body } = - await implementation.activityDeleteRepoSubscription(input, ctx) + const { status, body } = await implementation.issuesUpdateMilestone( + input, + ctx + ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = responseValidationFactory([["200", s_milestone]], undefined)( status, body ) @@ -97546,104 +53256,31 @@ export function bootstrap( } ) - const reposListTagsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const reposListTagsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("reposListTags", "/repos/:owner/:repo/tags", async (ctx, next) => { - const input = { - params: parseRequestInput(reposListTagsParamSchema, ctx.params), - query: parseRequestInput(reposListTagsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListTags(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - zipball_url: z.coerce.string(), - tarball_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const reposListTagProtectionParamSchema = z.object({ + const issuesDeleteMilestoneParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + milestone_number: z.coerce.number(), }) - router.get( - "reposListTagProtection", - "/repos/:owner/:repo/tags/protection", + router.delete( + "issuesDeleteMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber", async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListTagProtectionParamSchema, - ctx.params - ), + const input = { + params: parseRequestInput(issuesDeleteMilestoneParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.reposListTagProtection( + const { status, body } = await implementation.issuesDeleteMilestone( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - pattern: z.coerce.string(), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["204", z.void()], + ["404", s_basic_error], ], undefined )(status, body) @@ -97652,62 +53289,51 @@ export function bootstrap( } ) - const reposCreateTagProtectionParamSchema = z.object({ + const issuesListLabelsForMilestoneParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + milestone_number: z.coerce.number(), }) - const reposCreateTagProtectionBodySchema = z.object({ - pattern: z.coerce.string(), + const issuesListLabelsForMilestoneQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "reposCreateTagProtection", - "/repos/:owner/:repo/tags/protection", + router.get( + "issuesListLabelsForMilestone", + "/repos/:owner/:repo/milestones/:milestoneNumber/labels", async (ctx, next) => { const input = { params: parseRequestInput( - reposCreateTagProtectionParamSchema, + issuesListLabelsForMilestoneParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput(reposCreateTagProtectionBodySchema, ctx.body), + query: parseRequestInput( + issuesListLabelsForMilestoneQuerySchema, + ctx.query + ), + body: undefined, } - const { status, body } = await implementation.reposCreateTagProtection( - input, - ctx - ) + const { status, body } = + await implementation.issuesListLabelsForMilestone(input, ctx) ctx.body = responseValidationFactory( [ [ - "201", - z.object({ - id: z.coerce.number().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - pattern: z.coerce.string(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), ], ], undefined @@ -97717,50 +53343,226 @@ export function bootstrap( } ) - const reposDeleteTagProtectionParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - tag_protection_id: z.coerce.number(), - }) + const activityListRepoNotificationsForAuthenticatedUserParamSchema = z.object( + { owner: z.coerce.string(), repo: z.coerce.string() } + ) - router.delete( - "reposDeleteTagProtection", - "/repos/:owner/:repo/tags/protection/:tagProtectionId", + const activityListRepoNotificationsForAuthenticatedUserQuerySchema = z.object( + { + all: z.coerce.boolean().optional(), + participating: z.coerce.boolean().optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + before: z.coerce.string().datetime({ offset: true }).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + } + ) + + router.get( + "activityListRepoNotificationsForAuthenticatedUser", + "/repos/:owner/:repo/notifications", async (ctx, next) => { const input = { params: parseRequestInput( - reposDeleteTagProtectionParamSchema, + activityListRepoNotificationsForAuthenticatedUserParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + activityListRepoNotificationsForAuthenticatedUserQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposDeleteTagProtection( - input, - ctx - ) + const { status, body } = + await implementation.activityListRepoNotificationsForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + ), ], ], undefined @@ -97770,104 +53572,75 @@ export function bootstrap( } ) - const reposDownloadTarballArchiveParamSchema = z.object({ + const activityMarkRepoNotificationsAsReadParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), }) - router.get( - "reposDownloadTarballArchive", - "/repos/:owner/:repo/tarball/:ref", + const activityMarkRepoNotificationsAsReadBodySchema = z + .object({ + last_read_at: z.coerce.string().datetime({ offset: true }).optional(), + }) + .optional() + + router.put( + "activityMarkRepoNotificationsAsRead", + "/repos/:owner/:repo/notifications", async (ctx, next) => { const input = { params: parseRequestInput( - reposDownloadTarballArchiveParamSchema, + activityMarkRepoNotificationsAsReadParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + activityMarkRepoNotificationsAsReadBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposDownloadTarballArchive( - input, - ctx - ) + const { status, body } = + await implementation.activityMarkRepoNotificationsAsRead(input, ctx) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + [ + "202", + z.object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }), + ], + ["205", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposListTeamsParamSchema = z.object({ + const reposGetPagesParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposListTeamsQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - router.get( - "reposListTeams", - "/repos/:owner/:repo/teams", + "reposGetPages", + "/repos/:owner/:repo/pages", async (ctx, next) => { const input = { - params: parseRequestInput(reposListTeamsParamSchema, ctx.params), - query: parseRequestInput(reposListTeamsQuerySchema, ctx.query), + params: parseRequestInput(reposGetPagesParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposListTeams(input, ctx) + const { status, body } = await implementation.reposGetPages(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], + ["200", s_page], + ["404", s_basic_error], ], undefined )(status, body) @@ -97876,43 +53649,41 @@ export function bootstrap( } ) - const reposGetAllTopicsParamSchema = z.object({ + const reposCreatePagesSiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposGetAllTopicsQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), + const reposCreatePagesSiteBodySchema = z.object({ + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ + branch: z.coerce.string(), + path: z.enum(["/", "/docs"]).optional(), + }) + .optional(), }) - router.get( - "reposGetAllTopics", - "/repos/:owner/:repo/topics", + router.post( + "reposCreatePagesSite", + "/repos/:owner/:repo/pages", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetAllTopicsParamSchema, ctx.params), - query: parseRequestInput(reposGetAllTopicsQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(reposCreatePagesSiteParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreatePagesSiteBodySchema, ctx.body), } - const { status, body } = await implementation.reposGetAllTopics( + const { status, body } = await implementation.reposCreatePagesSite( input, ctx ) ctx.body = responseValidationFactory( [ - ["200", z.object({ names: z.array(z.coerce.string()) })], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["201", s_page], + ["409", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -97921,50 +53692,43 @@ export function bootstrap( } ) - const reposReplaceAllTopicsParamSchema = z.object({ + const reposUpdateInformationAboutPagesSiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposReplaceAllTopicsBodySchema = z.object({ - names: z.array(z.coerce.string()), + const reposUpdateInformationAboutPagesSiteBodySchema = z.object({ + cname: z.coerce.string().optional(), + https_enforced: z.coerce.boolean().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z.object({}).optional(), }) router.put( - "reposReplaceAllTopics", - "/repos/:owner/:repo/topics", + "reposUpdateInformationAboutPagesSite", + "/repos/:owner/:repo/pages", async (ctx, next) => { const input = { - params: parseRequestInput(reposReplaceAllTopicsParamSchema, ctx.params), + params: parseRequestInput( + reposUpdateInformationAboutPagesSiteParamSchema, + ctx.params + ), query: undefined, - body: parseRequestInput(reposReplaceAllTopicsBodySchema, ctx.body), + body: parseRequestInput( + reposUpdateInformationAboutPagesSiteBodySchema, + ctx.body + ), } - const { status, body } = await implementation.reposReplaceAllTopics( - input, - ctx - ) + const { status, body } = + await implementation.reposUpdateInformationAboutPagesSite(input, ctx) ctx.body = responseValidationFactory( [ - ["200", z.object({ names: z.array(z.coerce.string()) })], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["204", z.void()], + ["400", s_scim_error], + ["409", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -97973,52 +53737,32 @@ export function bootstrap( } ) - const reposGetClonesParamSchema = z.object({ + const reposDeletePagesSiteParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposGetClonesQuerySchema = z.object({ - per: z.enum(["", "day", "week"]).optional(), - }) - - router.get( - "reposGetClones", - "/repos/:owner/:repo/traffic/clones", + router.delete( + "reposDeletePagesSite", + "/repos/:owner/:repo/pages", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetClonesParamSchema, ctx.params), - query: parseRequestInput(reposGetClonesQuerySchema, ctx.query), + params: parseRequestInput(reposDeletePagesSiteParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetClones(input, ctx) + const { status, body } = await implementation.reposDeletePagesSite( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - count: z.coerce.number(), - uniques: z.coerce.number(), - clones: z.array( - z.object({ - timestamp: z.coerce.string().datetime({ offset: true }), - uniques: z.coerce.number(), - count: z.coerce.number(), - }) - ), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["204", z.void()], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -98027,22 +53771,30 @@ export function bootstrap( } ) - const reposGetTopPathsParamSchema = z.object({ + const reposListPagesBuildsParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) + const reposListPagesBuildsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + router.get( - "reposGetTopPaths", - "/repos/:owner/:repo/traffic/popular/paths", + "reposListPagesBuilds", + "/repos/:owner/:repo/pages/builds", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetTopPathsParamSchema, ctx.params), - query: undefined, + params: parseRequestInput(reposListPagesBuildsParamSchema, ctx.params), + query: parseRequestInput(reposListPagesBuildsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposGetTopPaths(input, ctx) + const { status, body } = await implementation.reposListPagesBuilds( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -98050,22 +53802,39 @@ export function bootstrap( "200", z.array( z.object({ - path: z.coerce.string(), - title: z.coerce.string(), - count: z.coerce.number(), - uniques: z.coerce.number(), + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }) ), ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], ], undefined )(status, body) @@ -98074,48 +53843,31 @@ export function bootstrap( } ) - const reposGetTopReferrersParamSchema = z.object({ + const reposRequestPagesBuildParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.get( - "reposGetTopReferrers", - "/repos/:owner/:repo/traffic/popular/referrers", + router.post( + "reposRequestPagesBuild", + "/repos/:owner/:repo/pages/builds", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetTopReferrersParamSchema, ctx.params), + params: parseRequestInput( + reposRequestPagesBuildParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetTopReferrers( + const { status, body } = await implementation.reposRequestPagesBuild( input, ctx ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - referrer: z.coerce.string(), - count: z.coerce.number(), - uniques: z.coerce.number(), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], + [["201", s_page_build_status]], undefined )(status, body) ctx.status = status @@ -98123,283 +53875,104 @@ export function bootstrap( } ) - const reposGetViewsParamSchema = z.object({ + const reposGetLatestPagesBuildParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - const reposGetViewsQuerySchema = z.object({ - per: z.enum(["", "day", "week"]).optional(), - }) - router.get( - "reposGetViews", - "/repos/:owner/:repo/traffic/views", + "reposGetLatestPagesBuild", + "/repos/:owner/:repo/pages/builds/latest", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetViewsParamSchema, ctx.params), - query: parseRequestInput(reposGetViewsQuerySchema, ctx.query), + params: parseRequestInput( + reposGetLatestPagesBuildParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.reposGetViews(input, ctx) + const { status, body } = await implementation.reposGetLatestPagesBuild( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - count: z.coerce.number(), - uniques: z.coerce.number(), - views: z.array( - z.object({ - timestamp: z.coerce.string().datetime({ offset: true }), - uniques: z.coerce.number(), - count: z.coerce.number(), - }) - ), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_page_build]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposTransferParamSchema = z.object({ + const reposGetPagesBuildParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), + build_id: z.coerce.number(), }) - const reposTransferBodySchema = z.object({ - new_owner: z.coerce.string(), - new_name: z.coerce.string().optional(), - team_ids: z.array(z.coerce.number()).optional(), - }) - - router.post( - "reposTransfer", - "/repos/:owner/:repo/transfer", + router.get( + "reposGetPagesBuild", + "/repos/:owner/:repo/pages/builds/:buildId", async (ctx, next) => { const input = { - params: parseRequestInput(reposTransferParamSchema, ctx.params), + params: parseRequestInput(reposGetPagesBuildParamSchema, ctx.params), query: undefined, - body: parseRequestInput(reposTransferBodySchema, ctx.body), + body: undefined, } - const { status, body } = await implementation.reposTransfer(input, ctx) + const { status, body } = await implementation.reposGetPagesBuild( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "202", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_page_build]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const reposCheckVulnerabilityAlertsParamSchema = z.object({ + const reposCreatePagesDeploymentParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.get( - "reposCheckVulnerabilityAlerts", - "/repos/:owner/:repo/vulnerability-alerts", + const reposCreatePagesDeploymentBodySchema = z.object({ + artifact_url: z.coerce.string(), + environment: z.coerce.string().optional(), + pages_build_version: z.coerce.string(), + oidc_token: z.coerce.string(), + }) + + router.post( + "reposCreatePagesDeployment", + "/repos/:owner/:repo/pages/deployment", async (ctx, next) => { const input = { params: parseRequestInput( - reposCheckVulnerabilityAlertsParamSchema, + reposCreatePagesDeploymentParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(reposCreatePagesDeploymentBodySchema, ctx.body), } - const { status, body } = - await implementation.reposCheckVulnerabilityAlerts(input, ctx) + const { status, body } = await implementation.reposCreatePagesDeployment( + input, + ctx + ) ctx.body = responseValidationFactory( [ - ["204", z.void()], - ["404", z.void()], + ["200", s_page_deployment], + ["400", s_scim_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -98408,149 +53981,722 @@ export function bootstrap( } ) - const reposEnableVulnerabilityAlertsParamSchema = z.object({ + const reposGetPagesHealthCheckParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.put( - "reposEnableVulnerabilityAlerts", - "/repos/:owner/:repo/vulnerability-alerts", + router.get( + "reposGetPagesHealthCheck", + "/repos/:owner/:repo/pages/health", async (ctx, next) => { const input = { params: parseRequestInput( - reposEnableVulnerabilityAlertsParamSchema, + reposGetPagesHealthCheckParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.reposEnableVulnerabilityAlerts(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body + const { status, body } = await implementation.reposGetPagesHealthCheck( + input, + ctx ) + + ctx.body = responseValidationFactory( + [ + ["200", s_pages_health_check], + ["202", s_empty_object], + ["400", z.void()], + ["404", s_basic_error], + ["422", z.void()], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDisableVulnerabilityAlertsParamSchema = z.object({ + const projectsListForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), }) - router.delete( - "reposDisableVulnerabilityAlerts", - "/repos/:owner/:repo/vulnerability-alerts", + const projectsListForRepoQuerySchema = z.object({ + state: z.enum(["open", "closed", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "projectsListForRepo", + "/repos/:owner/:repo/projects", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDisableVulnerabilityAlertsParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(projectsListForRepoParamSchema, ctx.params), + query: parseRequestInput(projectsListForRepoQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposDisableVulnerabilityAlerts(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body + const { status, body } = await implementation.projectsListForRepo( + input, + ctx ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposDownloadZipballArchiveParamSchema = z.object({ + const projectsCreateForRepoParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - ref: z.coerce.string(), }) - router.get( - "reposDownloadZipballArchive", - "/repos/:owner/:repo/zipball/:ref", + const projectsCreateForRepoBodySchema = z.object({ + name: z.coerce.string(), + body: z.coerce.string().optional(), + }) + + router.post( + "projectsCreateForRepo", + "/repos/:owner/:repo/projects", async (ctx, next) => { const input = { - params: parseRequestInput( - reposDownloadZipballArchiveParamSchema, - ctx.params - ), + params: parseRequestInput(projectsCreateForRepoParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(projectsCreateForRepoBodySchema, ctx.body), } - const { status, body } = await implementation.reposDownloadZipballArchive( + const { status, body } = await implementation.projectsCreateForRepo( input, ctx ) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["201", s_project], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const reposCreateUsingTemplateParamSchema = z.object({ - template_owner: z.coerce.string(), - template_repo: z.coerce.string(), + const pullsListParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const reposCreateUsingTemplateBodySchema = z.object({ - owner: z.coerce.string().optional(), - name: z.coerce.string(), - description: z.coerce.string().optional(), - include_all_branches: z.coerce.boolean().optional(), - private: z.coerce.boolean().optional(), + const pullsListQuerySchema = z.object({ + state: z.enum(["open", "closed", "all"]).optional(), + head: z.coerce.string().optional(), + base: z.coerce.string().optional(), + sort: z + .enum(["created", "updated", "popularity", "long-running"]) + .optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "reposCreateUsingTemplate", - "/repos/:templateOwner/:templateRepo/generate", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposCreateUsingTemplateParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput(reposCreateUsingTemplateBodySchema, ctx.body), - } + router.get("pullsList", "/repos/:owner/:repo/pulls", async (ctx, next) => { + const input = { + params: parseRequestInput(pullsListParamSchema, ctx.params), + query: parseRequestInput(pullsListQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = await implementation.reposCreateUsingTemplate( - input, - ctx - ) + const { status, body } = await implementation.pullsList(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = responseValidationFactory( + [ [ - [ - "201", + "200", + z.array( z.object({ + url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ url: z.coerce.string(), - spdx_id: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), }), - organization: z - .object({ + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -98572,215 +54718,281 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + }), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + forks: z.coerce.number(), permissions: z .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -98800,254 +55012,131 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - ], + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) + ["304", z.void()], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) - const reposListPublicQuerySchema = z.object({ - since: z.coerce.number().optional(), + const pullsCreateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.get("reposListPublic", "/repositories", async (ctx, next) => { + const pullsCreateBodySchema = z.object({ + title: z.coerce.string().optional(), + head: z.coerce.string(), + base: z.coerce.string(), + body: z.coerce.string().optional(), + maintainer_can_modify: z.coerce.boolean().optional(), + draft: z.coerce.boolean().optional(), + issue: z.coerce.number().optional(), + }) + + router.post("pullsCreate", "/repos/:owner/:repo/pulls", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput(reposListPublicQuerySchema, ctx.query), - body: undefined, + params: parseRequestInput(pullsCreateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsCreateBodySchema, ctx.body), } - const { status, body } = await implementation.reposListPublic(input, ctx) + const { status, body } = await implementation.pullsCreate(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ["304", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["201", s_pull_request], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -99055,91 +55144,122 @@ export function bootstrap( return next() }) - const actionsListEnvironmentSecretsParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), + const pullsListReviewCommentsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const actionsListEnvironmentSecretsQuerySchema = z.object({ + const pullsListReviewCommentsForRepoQuerySchema = z.object({ + sort: z.enum(["created", "updated", "created_at"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "actionsListEnvironmentSecrets", - "/repositories/:repositoryId/environments/:environmentName/secrets", + "pullsListReviewCommentsForRepo", + "/repos/:owner/:repo/pulls/comments", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListEnvironmentSecretsParamSchema, + pullsListReviewCommentsForRepoParamSchema, ctx.params ), query: parseRequestInput( - actionsListEnvironmentSecretsQuerySchema, + pullsListReviewCommentsForRepoQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.actionsListEnvironmentSecrets(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsGetEnvironmentPublicKeyParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - }) - - router.get( - "actionsGetEnvironmentPublicKey", - "/repositories/:repositoryId/environments/:environmentName/secrets/public-key", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetEnvironmentPublicKeyParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetEnvironmentPublicKey(input, ctx) + await implementation.pullsListReviewCommentsForRepo(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - key_id: z.coerce.string(), - key: z.coerce.string(), - id: z.coerce.number().optional(), - url: z.coerce.string().optional(), - title: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - }), + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ), ], ], undefined @@ -99149,40 +55269,31 @@ export function bootstrap( } ) - const actionsGetEnvironmentSecretParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - secret_name: z.coerce.string(), + const pullsGetReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), }) router.get( - "actionsGetEnvironmentSecret", - "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + "pullsGetReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsGetEnvironmentSecretParamSchema, - ctx.params - ), + params: parseRequestInput(pullsGetReviewCommentParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = await implementation.actionsGetEnvironmentSecret( + const { status, body } = await implementation.pullsGetReviewComment( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_pull_request_review_comment], + ["404", s_basic_error], ], undefined )(status, body) @@ -99191,41 +55302,36 @@ export function bootstrap( } ) - const actionsCreateOrUpdateEnvironmentSecretParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - secret_name: z.coerce.string(), + const pullsUpdateReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), }) - const actionsCreateOrUpdateEnvironmentSecretBodySchema = z.object({ - encrypted_value: z.coerce.string(), - key_id: z.coerce.string(), + const pullsUpdateReviewCommentBodySchema = z.object({ + body: z.coerce.string(), }) - router.put( - "actionsCreateOrUpdateEnvironmentSecret", - "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + router.patch( + "pullsUpdateReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateOrUpdateEnvironmentSecretParamSchema, + pullsUpdateReviewCommentParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsCreateOrUpdateEnvironmentSecretBodySchema, - ctx.body - ), + body: parseRequestInput(pullsUpdateReviewCommentBodySchema, ctx.body), } - const { status, body } = - await implementation.actionsCreateOrUpdateEnvironmentSecret(input, ctx) + const { status, body } = await implementation.pullsUpdateReviewComment( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - ["204", z.void()], - ], + [["200", s_pull_request_review_comment]], undefined )(status, body) ctx.status = status @@ -99233,82 +55339,133 @@ export function bootstrap( } ) - const actionsDeleteEnvironmentSecretParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - secret_name: z.coerce.string(), + const pullsDeleteReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), }) router.delete( - "actionsDeleteEnvironmentSecret", - "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + "pullsDeleteReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsDeleteEnvironmentSecretParamSchema, + pullsDeleteReviewCommentParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsDeleteEnvironmentSecret(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body + const { status, body } = await implementation.pullsDeleteReviewComment( + input, + ctx ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const actionsListEnvironmentVariablesParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), + const reactionsListForPullRequestReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), }) - const actionsListEnvironmentVariablesQuerySchema = z.object({ + const reactionsListForPullRequestReviewCommentQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "actionsListEnvironmentVariables", - "/repositories/:repositoryId/environments/:environmentName/variables", + "reactionsListForPullRequestReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - actionsListEnvironmentVariablesParamSchema, + reactionsListForPullRequestReviewCommentParamSchema, ctx.params ), query: parseRequestInput( - actionsListEnvironmentVariablesQuerySchema, + reactionsListForPullRequestReviewCommentQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.actionsListEnvironmentVariables(input, ctx) + await implementation.reactionsListForPullRequestReviewComment( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -99317,77 +55474,52 @@ export function bootstrap( } ) - const actionsCreateEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), + const reactionsCreateForPullRequestReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), }) - const actionsCreateEnvironmentVariableBodySchema = z.object({ - name: z.coerce.string(), - value: z.coerce.string(), + const reactionsCreateForPullRequestReviewCommentBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), }) router.post( - "actionsCreateEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables", + "reactionsCreateForPullRequestReviewComment", + "/repos/:owner/:repo/pulls/comments/:commentId/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - actionsCreateEnvironmentVariableParamSchema, + reactionsCreateForPullRequestReviewCommentParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - actionsCreateEnvironmentVariableBodySchema, + reactionsCreateForPullRequestReviewCommentBodySchema, ctx.body ), } const { status, body } = - await implementation.actionsCreateEnvironmentVariable(input, ctx) - - ctx.body = responseValidationFactory([["201", z.object({})]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const actionsGetEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), - }) - - router.get( - "actionsGetEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetEnvironmentVariableParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetEnvironmentVariable(input, ctx) + await implementation.reactionsCreateForPullRequestReviewComment( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], ], undefined )(status, body) @@ -99396,35 +55528,28 @@ export function bootstrap( } ) - const actionsUpdateEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), - }) - - const actionsUpdateEnvironmentVariableBodySchema = z.object({ - name: z.coerce.string().optional(), - value: z.coerce.string().optional(), + const reactionsDeleteForPullRequestCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + comment_id: z.coerce.number(), + reaction_id: z.coerce.number(), }) - router.patch( - "actionsUpdateEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", + router.delete( + "reactionsDeleteForPullRequestComment", + "/repos/:owner/:repo/pulls/comments/:commentId/reactions/:reactionId", async (ctx, next) => { const input = { params: parseRequestInput( - actionsUpdateEnvironmentVariableParamSchema, + reactionsDeleteForPullRequestCommentParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - actionsUpdateEnvironmentVariableBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.actionsUpdateEnvironmentVariable(input, ctx) + await implementation.reactionsDeleteForPullRequestComment(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -99435,367 +55560,200 @@ export function bootstrap( } ) - const actionsDeleteEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), + const pullsGetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - router.delete( - "actionsDeleteEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", + router.get( + "pullsGet", + "/repos/:owner/:repo/pulls/:pullNumber", async (ctx, next) => { const input = { - params: parseRequestInput( - actionsDeleteEnvironmentVariableParamSchema, - ctx.params - ), + params: parseRequestInput(pullsGetParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.actionsDeleteEnvironmentVariable(input, ctx) + const { status, body } = await implementation.pullsGet(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request], + ["304", z.void()], + ["404", s_basic_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) ctx.status = status return next() } ) - const searchCodeQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["indexed"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const pullsUpdateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - router.get("searchCode", "/search/code", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchCodeQuerySchema, ctx.query), - body: undefined, - } + const pullsUpdateBodySchema = z + .object({ + title: z.coerce.string().optional(), + body: z.coerce.string().optional(), + state: z.enum(["open", "closed"]).optional(), + base: z.coerce.string().optional(), + maintainer_can_modify: z.coerce.boolean().optional(), + }) + .optional() - const { status, body } = await implementation.searchCode(input, ctx) + router.patch( + "pullsUpdate", + "/repos/:owner/:repo/pulls/:pullNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsUpdateParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsUpdateBodySchema, ctx.body), + } - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - git_url: z.coerce.string(), - html_url: z.coerce.string(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - score: z.coerce.number(), - file_size: z.coerce.number().optional(), - language: z.coerce.string().optional(), - last_modified_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - line_numbers: z.array(z.coerce.string()).optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + const { status, body } = await implementation.pullsUpdate(input, ctx) + + ctx.body = responseValidationFactory( [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + ["200", s_pull_request], + ["403", s_basic_error], + ["422", s_validation_error], ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateWithPrForAuthenticatedUserParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const codespacesCreateWithPrForAuthenticatedUserBodySchema = z.object({ + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + multi_repo_permissions_opt_out: z.coerce.boolean().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + display_name: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + }) + + router.post( + "codespacesCreateWithPrForAuthenticatedUser", + "/repos/:owner/:repo/pulls/:pullNumber/codespaces", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCreateWithPrForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesCreateWithPrForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateWithPrForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + ["201", s_codespace], + ["202", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], ], - ], - undefined - )(status, body) - ctx.status = status - return next() + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListReviewCommentsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - const searchCommitsQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["author-date", "committer-date"]).optional(), - order: z.enum(["desc", "asc"]).optional(), + const pullsListReviewCommentsQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get("searchCommits", "/search/commits", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchCommitsQuerySchema, ctx.query), - body: undefined, - } + router.get( + "pullsListReviewComments", + "/repos/:owner/:repo/pulls/:pullNumber/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsListReviewCommentsParamSchema, + ctx.params + ), + query: parseRequestInput(pullsListReviewCommentsQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = await implementation.searchCommits(input, ctx) + const { status, body } = await implementation.pullsListReviewComments( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ + ctx.body = responseValidationFactory( [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( + [ + "200", + z.array( z.object({ url: z.coerce.string(), - sha: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - comment_count: z.coerce.number(), - message: z.coerce.string(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - url: z.coerce.string(), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -99818,861 +55776,1734 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), }), - parents: z.array( - z.object({ - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - }) - ), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - score: z.coerce.number(), - node_id: z.coerce.string(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), }) ), - }), + ], ], - ["304", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsCreateReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), }) - const searchIssuesAndPullRequestsQuerySchema = z.object({ - q: z.coerce.string(), - sort: z - .enum([ - "comments", - "reactions", - "reactions-+1", - "reactions--1", - "reactions-smile", - "reactions-thinking_face", - "reactions-heart", - "reactions-tada", - "interactions", - "created", - "updated", - ]) - .optional(), - order: z.enum(["desc", "asc"]).optional(), + const pullsCreateReviewCommentBodySchema = z.object({ + body: z.coerce.string(), + commit_id: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number(), + start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT", "side"]).optional(), + in_reply_to: z.coerce.number().optional(), + }) + + router.post( + "pullsCreateReviewComment", + "/repos/:owner/:repo/pulls/:pullNumber/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsCreateReviewCommentParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(pullsCreateReviewCommentBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsCreateReviewComment( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_pull_request_review_comment], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsCreateReplyForReviewCommentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + comment_id: z.coerce.number(), + }) + + const pullsCreateReplyForReviewCommentBodySchema = z.object({ + body: z.coerce.string(), + }) + + router.post( + "pullsCreateReplyForReviewComment", + "/repos/:owner/:repo/pulls/:pullNumber/comments/:commentId/replies", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsCreateReplyForReviewCommentParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + pullsCreateReplyForReviewCommentBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.pullsCreateReplyForReviewComment(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_pull_request_review_comment], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListCommitsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsListCommitsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "searchIssuesAndPullRequests", - "/search/issues", + "pullsListCommits", + "/repos/:owner/:repo/pulls/:pullNumber/commits", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - searchIssuesAndPullRequestsQuerySchema, - ctx.query - ), + params: parseRequestInput(pullsListCommitsParamSchema, ctx.params), + query: parseRequestInput(pullsListCommitsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.searchIssuesAndPullRequests( - input, - ctx - ) + const { status, body } = await implementation.pullsListCommits(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ + z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - title: z.coerce.string(), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - user: z.object({ + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + date: z.coerce.string().optional(), }), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - description: z.coerce.string().optional(), - }) - ), - state: z.coerce.string(), - state_reason: z.coerce.string().optional(), - assignee: z.object({ + committer: z.object({ name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - comments: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - body: z.coerce.string().optional(), - score: z.coerce.number(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - draft: z.coerce.boolean().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - performed_via_github_app: z + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), }) .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), }) - .optional(), - }) - ), + ) + .optional(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListFilesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsListFilesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "pullsListFiles", + "/repos/:owner/:repo/pulls/:pullNumber/files", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsListFilesParamSchema, ctx.params), + query: parseRequestInput(pullsListFilesQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.pullsListFiles(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsCheckIfMergedParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + router.get( + "pullsCheckIfMerged", + "/repos/:owner/:repo/pulls/:pullNumber/merge", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsCheckIfMergedParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsCheckIfMerged( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsMergeParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsMergeBodySchema = z + .object({ + commit_title: z.coerce.string().optional(), + commit_message: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + merge_method: z.enum(["merge", "squash", "rebase"]).optional(), + }) + .optional() + + router.put( + "pullsMerge", + "/repos/:owner/:repo/pulls/:pullNumber/merge", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsMergeParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsMergeBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsMerge(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_merge_result], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "405", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), }), ], - ["304", z.void()], [ - "403", + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListRequestedReviewersParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + router.get( + "pullsListRequestedReviewers", + "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsListRequestedReviewersParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsListRequestedReviewers( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_pull_request_review_request]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsRequestReviewersParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsRequestReviewersBodySchema = z + .object({ + reviewers: z.array(z.coerce.string()).optional(), + team_reviewers: z.array(z.coerce.string()).optional(), + }) + .optional() + + router.post( + "pullsRequestReviewers", + "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsRequestReviewersParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsRequestReviewersBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsRequestReviewers( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_pull_request_simple], + ["403", s_basic_error], + ["422", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsRemoveRequestedReviewersParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsRemoveRequestedReviewersBodySchema = z.object({ + reviewers: z.array(z.coerce.string()), + team_reviewers: z.array(z.coerce.string()).optional(), + }) + + router.delete( + "pullsRemoveRequestedReviewers", + "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsRemoveRequestedReviewersParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + pullsRemoveRequestedReviewersBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.pullsRemoveRequestedReviewers(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_simple], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListReviewsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsListReviewsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "pullsListReviews", + "/repos/:owner/:repo/pulls/:pullNumber/reviews", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsListReviewsParamSchema, ctx.params), + query: parseRequestInput(pullsListReviewsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.pullsListReviews(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsCreateReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsCreateReviewBodySchema = z + .object({ + commit_id: z.coerce.string().optional(), + body: z.coerce.string().optional(), + event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]).optional(), + comments: z + .array( + z.object({ + path: z.coerce.string(), + position: z.coerce.number().optional(), + body: z.coerce.string(), + line: z.coerce.number().optional(), + side: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + start_side: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional() + + router.post( + "pullsCreateReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsCreateReviewParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsCreateReviewBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsCreateReview( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["403", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsGetReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + router.get( + "pullsGetReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsGetReviewParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsGetReview(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsUpdateReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + const pullsUpdateReviewBodySchema = z.object({ body: z.coerce.string() }) + + router.put( + "pullsUpdateReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsUpdateReviewParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsUpdateReviewBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsUpdateReview( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsDeletePendingReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + router.delete( + "pullsDeletePendingReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsDeletePendingReviewParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.pullsDeletePendingReview( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsListCommentsForReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + const pullsListCommentsForReviewQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "pullsListCommentsForReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + pullsListCommentsForReviewParamSchema, + ctx.params + ), + query: parseRequestInput( + pullsListCommentsForReviewQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.pullsListCommentsForReview( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsDismissReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + const pullsDismissReviewBodySchema = z.object({ + message: z.coerce.string(), + event: z.enum(["DISMISS"]).optional(), + }) + + router.put( + "pullsDismissReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/dismissals", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsDismissReviewParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsDismissReviewBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsDismissReview( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsSubmitReviewParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + review_id: z.coerce.number(), + }) + + const pullsSubmitReviewBodySchema = z.object({ + body: z.coerce.string().optional(), + event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), + }) + + router.post( + "pullsSubmitReview", + "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/events", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsSubmitReviewParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsSubmitReviewBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsSubmitReview( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const pullsUpdateBranchParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + pull_number: z.coerce.number(), + }) + + const pullsUpdateBranchBodySchema = z + .object({ expected_head_sha: z.coerce.string().optional() }) + .optional() + + router.put( + "pullsUpdateBranch", + "/repos/:owner/:repo/pulls/:pullNumber/update-branch", + async (ctx, next) => { + const input = { + params: parseRequestInput(pullsUpdateBranchParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(pullsUpdateBranchBodySchema, ctx.body), + } + + const { status, body } = await implementation.pullsUpdateBranch( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "202", z.object({ message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetReadmeParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposGetReadmeQuerySchema = z.object({ + ref: z.coerce.string().optional(), + }) + + router.get( + "reposGetReadme", + "/repos/:owner/:repo/readme", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetReadmeParamSchema, ctx.params), + query: parseRequestInput(reposGetReadmeQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetReadme(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_content_file], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetReadmeInDirectoryParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + dir: z.coerce.string(), + }) + + const reposGetReadmeInDirectoryQuerySchema = z.object({ + ref: z.coerce.string().optional(), + }) + + router.get( + "reposGetReadmeInDirectory", + "/repos/:owner/:repo/readme/:dir", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetReadmeInDirectoryParamSchema, + ctx.params + ), + query: parseRequestInput( + reposGetReadmeInDirectoryQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.reposGetReadmeInDirectory( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_content_file], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposListReleasesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListReleasesQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListReleases", + "/repos/:owner/:repo/releases", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListReleasesParamSchema, ctx.params), + query: parseRequestInput(reposListReleasesQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListReleases( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( + "200", + z.array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), }) - ) - .optional(), - }), + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposCreateReleaseBodySchema = z.object({ + tag_name: z.coerce.string(), + target_commitish: z.coerce.string().optional(), + name: z.coerce.string().optional(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean().optional(), + prerelease: z.coerce.boolean().optional(), + discussion_category_name: z.coerce.string().optional(), + generate_release_notes: z.coerce.boolean().optional(), + make_latest: z.enum(["true", "false", "legacy"]).optional(), + }) + + router.post( + "reposCreateRelease", + "/repos/:owner/:repo/releases", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCreateReleaseParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposCreateReleaseBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_release], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + asset_id: z.coerce.number(), + }) + + router.get( + "reposGetReleaseAsset", + "/repos/:owner/:repo/releases/assets/:assetId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetReleaseAssetParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetReleaseAsset( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_release_asset], + ["302", z.void()], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + asset_id: z.coerce.number(), + }) + + const reposUpdateReleaseAssetBodySchema = z + .object({ + name: z.coerce.string().optional(), + label: z.coerce.string().optional(), + state: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "reposUpdateReleaseAsset", + "/repos/:owner/:repo/releases/assets/:assetId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUpdateReleaseAssetParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposUpdateReleaseAssetBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdateReleaseAsset( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_release_asset]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + asset_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteReleaseAsset", + "/repos/:owner/:repo/releases/assets/:assetId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposDeleteReleaseAssetParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeleteReleaseAsset( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposGenerateReleaseNotesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposGenerateReleaseNotesBodySchema = z.object({ + tag_name: z.coerce.string(), + target_commitish: z.coerce.string().optional(), + previous_tag_name: z.coerce.string().optional(), + configuration_file_path: z.coerce.string().optional(), + }) + + router.post( + "reposGenerateReleaseNotes", + "/repos/:owner/:repo/releases/generate-notes", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGenerateReleaseNotesParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reposGenerateReleaseNotesBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposGenerateReleaseNotes( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_release_notes_content], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetLatestReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "reposGetLatestRelease", + "/repos/:owner/:repo/releases/latest", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetLatestReleaseParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetLatestRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory([["200", s_release]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposGetReleaseByTagParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + tag: z.coerce.string(), + }) + + router.get( + "reposGetReleaseByTag", + "/repos/:owner/:repo/releases/tags/:tag", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetReleaseByTagParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetReleaseByTag( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_release], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + }) + + router.get( + "reposGetRelease", + "/repos/:owner/:repo/releases/:releaseId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetReleaseParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposGetRelease(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_release], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposUpdateReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + }) + + const reposUpdateReleaseBodySchema = z + .object({ + tag_name: z.coerce.string().optional(), + target_commitish: z.coerce.string().optional(), + name: z.coerce.string().optional(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean().optional(), + prerelease: z.coerce.boolean().optional(), + make_latest: z.enum(["true", "false", "legacy"]).optional(), + discussion_category_name: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "reposUpdateRelease", + "/repos/:owner/:repo/releases/:releaseId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposUpdateReleaseParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposUpdateReleaseBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUpdateRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_release], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposDeleteReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + }) + + router.delete( + "reposDeleteRelease", + "/repos/:owner/:repo/releases/:releaseId", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposDeleteReleaseParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reposDeleteRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListReleaseAssetsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + }) + + const reposListReleaseAssetsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListReleaseAssets", + "/repos/:owner/:repo/releases/:releaseId/assets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListReleaseAssetsParamSchema, + ctx.params + ), + query: parseRequestInput(reposListReleaseAssetsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListReleaseAssets( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), ], ], undefined @@ -100682,145 +57513,90 @@ export function bootstrap( } ) - const searchLabelsQuerySchema = z.object({ - repository_id: z.coerce.number(), - q: z.coerce.string(), - sort: z.enum(["created", "updated"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposUploadReleaseAssetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - router.get("searchLabels", "/search/labels", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchLabelsQuerySchema, ctx.query), - body: undefined, - } + const reposUploadReleaseAssetQuerySchema = z.object({ + name: z.coerce.string(), + label: z.coerce.string().optional(), + }) - const { status, body } = await implementation.searchLabels(input, ctx) + const reposUploadReleaseAssetBodySchema = z.coerce.string().optional() - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - description: z.coerce.string(), - score: z.coerce.number(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + router.post( + "reposUploadReleaseAsset", + "/repos/:owner/:repo/releases/:releaseId/assets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposUploadReleaseAssetParamSchema, + ctx.params + ), + query: parseRequestInput(reposUploadReleaseAssetQuerySchema, ctx.query), + body: parseRequestInput(reposUploadReleaseAssetBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposUploadReleaseAsset( + input, + ctx + ) + + ctx.body = responseValidationFactory( [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + ["201", s_release_asset], + ["422", z.void()], ], - ], - undefined - )(status, body) - ctx.status = status - return next() + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsListForReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - const searchReposQuerySchema = z.object({ - q: z.coerce.string(), - sort: z - .enum(["stars", "forks", "help-wanted-issues", "updated"]) + const reactionsListForReleaseQuerySchema = z.object({ + content: z + .enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]) .optional(), - order: z.enum(["desc", "asc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get("searchRepos", "/search/repositories", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchReposQuerySchema, ctx.query), - body: undefined, - } + router.get( + "reactionsListForRelease", + "/repos/:owner/:repo/releases/:releaseId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsListForReleaseParamSchema, + ctx.params + ), + query: parseRequestInput(reactionsListForReleaseQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = await implementation.searchRepos(input, ctx) + const { status, body } = await implementation.reactionsListForRelease( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ + ctx.body = responseValidationFactory( [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( + [ + "200", + z.array( z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -100843,308 +57619,147 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - pushed_at: z.coerce.string().datetime({ offset: true }), - homepage: z.coerce.string(), - size: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - open_issues_count: z.coerce.number(), - master_branch: z.coerce.string().optional(), - default_branch: z.coerce.string(), - score: z.coerce.number(), - forks_url: z.coerce.string(), - keys_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - teams_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - events_url: z.coerce.string(), - assignees_url: z.coerce.string(), - branches_url: z.coerce.string(), - tags_url: z.coerce.string(), - blobs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - trees_url: z.coerce.string(), - statuses_url: z.coerce.string(), - languages_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - contributors_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - commits_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - comments_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - contents_url: z.coerce.string(), - compare_url: z.coerce.string(), - merges_url: z.coerce.string(), - archive_url: z.coerce.string(), - downloads_url: z.coerce.string(), - issues_url: z.coerce.string(), - pulls_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - labels_url: z.coerce.string(), - releases_url: z.coerce.string(), - deployments_url: z.coerce.string(), - git_url: z.coerce.string(), - ssh_url: z.coerce.string(), - clone_url: z.coerce.string(), - svn_url: z.coerce.string(), - forks: z.coerce.number(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - topics: z.array(z.coerce.string()).optional(), - mirror_url: z.coerce.string(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), }) ), - }), - ], - ["304", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + ], + ["404", s_basic_error], ], - ], - undefined - )(status, body) - ctx.status = status - return next() + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reactionsCreateForReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), }) - const searchTopicsQuerySchema = z.object({ - q: z.coerce.string(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reactionsCreateForReleaseBodySchema = z.object({ + content: z.enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]), }) - router.get("searchTopics", "/search/topics", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchTopicsQuerySchema, ctx.query), - body: undefined, - } + router.post( + "reactionsCreateForRelease", + "/repos/:owner/:repo/releases/:releaseId/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsCreateForReleaseParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(reactionsCreateForReleaseBodySchema, ctx.body), + } - const { status, body } = await implementation.searchTopics(input, ctx) + const { status, body } = await implementation.reactionsCreateForRelease( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ + ctx.body = responseValidationFactory( [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - short_description: z.coerce.string(), - description: z.coerce.string(), - created_by: z.coerce.string(), - released: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - featured: z.coerce.boolean(), - curated: z.coerce.boolean(), - score: z.coerce.number(), - repository_count: z.coerce.number().optional(), - logo_url: z.coerce.string().optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - related: z - .array( - z.object({ - topic_relation: z - .object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - topic_id: z.coerce.number().optional(), - relation_type: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .optional(), - aliases: z - .array( - z.object({ - topic_relation: z - .object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - topic_id: z.coerce.number().optional(), - relation_type: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .optional(), - }) - ), - }), + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], ], - ["304", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const searchUsersQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["followers", "repositories", "joined"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reactionsDeleteForReleaseParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + release_id: z.coerce.number(), + reaction_id: z.coerce.number(), }) - router.get("searchUsers", "/search/users", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchUsersQuerySchema, ctx.query), - body: undefined, + router.delete( + "reactionsDeleteForRelease", + "/repos/:owner/:repo/releases/:releaseId/reactions/:reactionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsDeleteForReleaseParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.reactionsDeleteForRelease( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() } + ) + + const secretScanningListAlertsForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const secretScanningListAlertsForRepoQuerySchema = z.object({ + state: z.enum(["open", "resolved"]).optional(), + secret_type: z.coerce.string().optional(), + resolution: z.coerce.string().optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + }) - const { status, body } = await implementation.searchUsers(input, ctx) + router.get( + "secretScanningListAlertsForRepo", + "/repos/:owner/:repo/secret-scanning/alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningListAlertsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + secretScanningListAlertsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } - ctx.body = responseValidationFactory( - [ + const { status, body } = + await implementation.secretScanningListAlertsForRepo(input, ctx) + + ctx.body = responseValidationFactory( [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( + [ + "200", + z.array( z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - score: z.coerce.number(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - events_url: z.coerce.string(), - public_repos: z.coerce.number().optional(), - public_gists: z.coerce.number().optional(), - followers: z.coerce.number().optional(), - following: z.coerce.number().optional(), + number: z.coerce.number().optional(), created_at: z.coerce .string() .datetime({ offset: true }) @@ -101153,575 +57768,230 @@ export function bootstrap( .string() .datetime({ offset: true }) .optional(), - name: z.coerce.string().optional(), - bio: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - location: z.coerce.string().optional(), - site_admin: z.coerce.boolean(), - hireable: z.coerce.boolean().optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) .optional(), - blog: z.coerce.string().optional(), - company: z.coerce.string().optional(), - suspended_at: z.coerce + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce .string() .datetime({ offset: true }) .optional(), }) ), - }), - ], - ["304", z.void()], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const teamsGetLegacyParamSchema = z.object({ team_id: z.coerce.number() }) - - router.get("teamsGetLegacy", "/teams/:teamId", async (ctx, next) => { - const input = { - params: parseRequestInput(teamsGetLegacyParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.teamsGetLegacy(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), + ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), }), - ldap_dn: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + ], ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const teamsUpdateLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const teamsUpdateLegacyBodySchema = z.object({ - name: z.coerce.string(), - description: z.coerce.string().optional(), - privacy: z.enum(["secret", "closed"]).optional(), - permission: z.enum(["pull", "push", "admin"]).optional(), - parent_team_id: z.coerce.number().optional(), + const secretScanningGetAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), }) - router.patch("teamsUpdateLegacy", "/teams/:teamId", async (ctx, next) => { - const input = { - params: parseRequestInput(teamsUpdateLegacyParamSchema, ctx.params), - query: undefined, - body: parseRequestInput(teamsUpdateLegacyBodySchema, ctx.body), - } + router.get( + "secretScanningGetAlert", + "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningGetAlertParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } - const { status, body } = await implementation.teamsUpdateLegacy(input, ctx) + const { status, body } = await implementation.secretScanningGetAlert( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }), - ], + ctx.body = responseValidationFactory( [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), - }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce.boolean().optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce.boolean().optional(), - members_can_create_private_pages: z.coerce.boolean().optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), + ["200", s_secret_scanning_alert], + ["304", z.void()], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), }), - ldap_dn: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + ], ], - ], - undefined - )(status, body) - ctx.status = status - return next() + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const secretScanningUpdateAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), }) - const teamsDeleteLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + const secretScanningUpdateAlertBodySchema = z.object({ + state: z.enum(["open", "resolved"]), + resolution: z + .enum(["null", "false_positive", "wont_fix", "revoked", "used_in_tests"]) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) - router.delete("teamsDeleteLegacy", "/teams/:teamId", async (ctx, next) => { - const input = { - params: parseRequestInput(teamsDeleteLegacyParamSchema, ctx.params), - query: undefined, - body: undefined, - } + router.patch( + "secretScanningUpdateAlert", + "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningUpdateAlertParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput(secretScanningUpdateAlertBodySchema, ctx.body), + } - const { status, body } = await implementation.teamsDeleteLegacy(input, ctx) + const { status, body } = await implementation.secretScanningUpdateAlert( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ctx.body = responseValidationFactory( [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), + ["200", s_secret_scanning_alert], + ["400", z.void()], + ["404", z.void()], + ["422", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) + undefined + )(status, body) + ctx.status = status + return next() + } + ) - const teamsListDiscussionsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), + const secretScanningListLocationsForAlertParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + alert_number: z.coerce.number(), }) - const teamsListDiscussionsLegacyQuerySchema = z.object({ - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), + const secretScanningListLocationsForAlertQuerySchema = z.object({ page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), }) router.get( - "teamsListDiscussionsLegacy", - "/teams/:teamId/discussions", + "secretScanningListLocationsForAlert", + "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber/locations", async (ctx, next) => { const input = { params: parseRequestInput( - teamsListDiscussionsLegacyParamSchema, + secretScanningListLocationsForAlertParamSchema, ctx.params ), query: parseRequestInput( - teamsListDiscussionsLegacyQuerySchema, + secretScanningListLocationsForAlertQuerySchema, ctx.query ), body: undefined, } - const { status, body } = await implementation.teamsListDiscussionsLegacy( - input, - ctx - ) + const { status, body } = + await implementation.secretScanningListLocationsForAlert(input, ctx) ctx.body = responseValidationFactory( [ @@ -101729,62 +57999,30 @@ export function bootstrap( "200", z.array( z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), + type: z.enum([ + "commit", + "issue_title", + "issue_body", + "issue_comment", + ]), + details: z.union([ + s_secret_scanning_location_commit, + s_secret_scanning_location_issue_title, + s_secret_scanning_location_issue_body, + s_secret_scanning_location_issue_comment, + ]), }) ), ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], ], undefined )(status, body) @@ -101793,97 +58031,39 @@ export function bootstrap( } ) - const teamsCreateDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), + const activityListStargazersForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsCreateDiscussionLegacyBodySchema = z.object({ - title: z.coerce.string(), - body: z.coerce.string(), - private: z.coerce.boolean().optional(), + const activityListStargazersForRepoQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "teamsCreateDiscussionLegacy", - "/teams/:teamId/discussions", + router.get( + "activityListStargazersForRepo", + "/repos/:owner/:repo/stargazers", async (ctx, next) => { const input = { params: parseRequestInput( - teamsCreateDiscussionLegacyParamSchema, + activityListStargazersForRepoParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - teamsCreateDiscussionLegacyBodySchema, - ctx.body + query: parseRequestInput( + activityListStargazersForRepoQuerySchema, + ctx.query ), + body: undefined, } - const { status, body } = await implementation.teamsCreateDiscussionLegacy( - input, - ctx - ) + const { status, body } = + await implementation.activityListStargazersForRepo(input, ctx) ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], + ["200", z.object({})], + ["422", s_validation_error], ], undefined )(status, body) @@ -101892,89 +58072,34 @@ export function bootstrap( } ) - const teamsGetDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const reposGetCodeFrequencyStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.get( - "teamsGetDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber", + "reposGetCodeFrequencyStats", + "/repos/:owner/:repo/stats/code_frequency", async (ctx, next) => { const input = { params: parseRequestInput( - teamsGetDiscussionLegacyParamSchema, + reposGetCodeFrequencyStatsParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsGetDiscussionLegacy( + const { status, body } = await implementation.reposGetCodeFrequencyStats( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], + ["200", z.array(z.array(z.coerce.number()))], + ["202", z.object({})], + ["204", z.void()], ], undefined )(status, body) @@ -101983,35 +58108,25 @@ export function bootstrap( } ) - const teamsUpdateDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const reposGetCommitActivityStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsUpdateDiscussionLegacyBodySchema = z - .object({ - title: z.coerce.string().optional(), - body: z.coerce.string().optional(), - }) - .optional() - - router.patch( - "teamsUpdateDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber", + router.get( + "reposGetCommitActivityStats", + "/repos/:owner/:repo/stats/commit_activity", async (ctx, next) => { const input = { params: parseRequestInput( - teamsUpdateDiscussionLegacyParamSchema, + reposGetCommitActivityStatsParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - teamsUpdateDiscussionLegacyBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = await implementation.teamsUpdateDiscussionLegacy( + const { status, body } = await implementation.reposGetCommitActivityStats( input, ctx ) @@ -102020,62 +58135,16 @@ export function bootstrap( [ [ "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), + z.array( + z.object({ + days: z.array(z.coerce.number()), + total: z.coerce.number(), + week: z.coerce.number(), + }) + ), ], + ["202", z.object({})], + ["204", z.void()], ], undefined )(status, body) @@ -102084,68 +58153,29 @@ export function bootstrap( } ) - const teamsDeleteDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const reposGetContributorsStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.delete( - "teamsDeleteDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber", + router.get( + "reposGetContributorsStats", + "/repos/:owner/:repo/stats/contributors", async (ctx, next) => { const input = { params: parseRequestInput( - teamsDeleteDiscussionLegacyParamSchema, + reposGetContributorsStatsParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsDeleteDiscussionLegacy( + const { status, body } = await implementation.reposGetContributorsStats( input, ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const teamsListDiscussionCommentsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - }) - - const teamsListDiscussionCommentsLegacyQuerySchema = z.object({ - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "teamsListDiscussionCommentsLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsListDiscussionCommentsLegacyParamSchema, - ctx.params - ), - query: parseRequestInput( - teamsListDiscussionCommentsLegacyQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.teamsListDiscussionCommentsLegacy(input, ctx) - ctx.body = responseValidationFactory( [ [ @@ -102175,125 +58205,20 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + total: z.coerce.number(), + weeks: z.array( + z.object({ + w: z.coerce.number().optional(), + a: z.coerce.number().optional(), + d: z.coerce.number().optional(), + c: z.coerce.number().optional(), }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const teamsCreateDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - }) - - const teamsCreateDiscussionCommentLegacyBodySchema = z.object({ - body: z.coerce.string(), - }) - - router.post( - "teamsCreateDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - teamsCreateDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsCreateDiscussionCommentLegacyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.teamsCreateDiscussionCommentLegacy(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), + ), + }) + ), ], + ["202", z.object({})], + ["204", z.void()], ], undefined )(status, body) @@ -102302,83 +58227,33 @@ export function bootstrap( } ) - const teamsGetDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), + const reposGetParticipationStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.get( - "teamsGetDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", + "reposGetParticipationStats", + "/repos/:owner/:repo/stats/participation", async (ctx, next) => { const input = { params: parseRequestInput( - teamsGetDiscussionCommentLegacyParamSchema, + reposGetParticipationStatsParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.teamsGetDiscussionCommentLegacy(input, ctx) + const { status, body } = await implementation.reposGetParticipationStats( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], + ["200", s_participation_stats], + ["404", s_basic_error], ], undefined )(status, body) @@ -102387,90 +58262,33 @@ export function bootstrap( } ) - const teamsUpdateDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), - }) - - const teamsUpdateDiscussionCommentLegacyBodySchema = z.object({ - body: z.coerce.string(), + const reposGetPunchCardStatsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.patch( - "teamsUpdateDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", + router.get( + "reposGetPunchCardStats", + "/repos/:owner/:repo/stats/punch_card", async (ctx, next) => { const input = { params: parseRequestInput( - teamsUpdateDiscussionCommentLegacyParamSchema, + reposGetPunchCardStatsParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - teamsUpdateDiscussionCommentLegacyBodySchema, - ctx.body - ), + body: undefined, } - const { status, body } = - await implementation.teamsUpdateDiscussionCommentLegacy(input, ctx) + const { status, body } = await implementation.reposGetPunchCardStats( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }), - ], + ["200", z.array(z.array(z.coerce.number()))], + ["204", z.void()], ], undefined )(status, body) @@ -102479,29 +58297,38 @@ export function bootstrap( } ) - const teamsDeleteDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), + const reposCreateCommitStatusParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + sha: z.coerce.string(), }) - router.delete( - "teamsDeleteDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", + const reposCreateCommitStatusBodySchema = z.object({ + state: z.enum(["error", "failure", "pending", "success"]), + target_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + context: z.coerce.string().optional(), + }) + + router.post( + "reposCreateCommitStatus", + "/repos/:owner/:repo/statuses/:sha", async (ctx, next) => { const input = { params: parseRequestInput( - teamsDeleteDiscussionCommentLegacyParamSchema, + reposCreateCommitStatusParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(reposCreateCommitStatusBodySchema, ctx.body), } - const { status, body } = - await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) + const { status, body } = await implementation.reposCreateCommitStatus( + input, + ctx + ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = responseValidationFactory([["201", s_status]], undefined)( status, body ) @@ -102510,50 +58337,36 @@ export function bootstrap( } ) - const reactionsListForTeamDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), + const activityListWatchersForRepoParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const reactionsListForTeamDiscussionCommentLegacyQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), + const activityListWatchersForRepoQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "reactionsListForTeamDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", + "activityListWatchersForRepo", + "/repos/:owner/:repo/subscribers", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsListForTeamDiscussionCommentLegacyParamSchema, + activityListWatchersForRepoParamSchema, ctx.params ), query: parseRequestInput( - reactionsListForTeamDiscussionCommentLegacyQuerySchema, + activityListWatchersForRepoQuerySchema, ctx.query ), body: undefined, } - const { status, body } = - await implementation.reactionsListForTeamDiscussionCommentLegacy( - input, - ctx - ) + const { status, body } = await implementation.activityListWatchersForRepo( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -102561,102 +58374,6 @@ export function bootstrap( "200", z.array( z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reactionsCreateForTeamDiscussionCommentLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - comment_number: z.coerce.number(), - }) - - const reactionsCreateForTeamDiscussionCommentLegacyBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) - - router.post( - "reactionsCreateForTeamDiscussionCommentLegacy", - "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsCreateForTeamDiscussionCommentLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - reactionsCreateForTeamDiscussionCommentLegacyBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.reactionsCreateForTeamDiscussionCommentLegacy( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -102678,19 +58395,8 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), + }) + ), ], ], undefined @@ -102700,92 +58406,34 @@ export function bootstrap( } ) - const reactionsListForTeamDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), - }) - - const reactionsListForTeamDiscussionLegacyQuerySchema = z.object({ - content: z - .enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]) - .optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const activityGetRepoSubscriptionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.get( - "reactionsListForTeamDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber/reactions", + "activityGetRepoSubscription", + "/repos/:owner/:repo/subscription", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsListForTeamDiscussionLegacyParamSchema, + activityGetRepoSubscriptionParamSchema, ctx.params ), - query: parseRequestInput( - reactionsListForTeamDiscussionLegacyQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = - await implementation.reactionsListForTeamDiscussionLegacy(input, ctx) + const { status, body } = await implementation.activityGetRepoSubscription( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + ["200", s_repository_subscription], + ["403", s_basic_error], + ["404", z.void()], ], undefined )(status, body) @@ -102794,87 +58442,41 @@ export function bootstrap( } ) - const reactionsCreateForTeamDiscussionLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - discussion_number: z.coerce.number(), + const activitySetRepoSubscriptionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const reactionsCreateForTeamDiscussionLegacyBodySchema = z.object({ - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - }) + const activitySetRepoSubscriptionBodySchema = z + .object({ + subscribed: z.coerce.boolean().optional(), + ignored: z.coerce.boolean().optional(), + }) + .optional() - router.post( - "reactionsCreateForTeamDiscussionLegacy", - "/teams/:teamId/discussions/:discussionNumber/reactions", + router.put( + "activitySetRepoSubscription", + "/repos/:owner/:repo/subscription", async (ctx, next) => { const input = { params: parseRequestInput( - reactionsCreateForTeamDiscussionLegacyParamSchema, + activitySetRepoSubscriptionParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - reactionsCreateForTeamDiscussionLegacyBodySchema, + activitySetRepoSubscriptionBodySchema, ctx.body ), } - const { status, body } = - await implementation.reactionsCreateForTeamDiscussionLegacy(input, ctx) + const { status, body } = await implementation.activitySetRepoSubscription( + input, + ctx + ) ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], + [["200", s_repository_subscription]], undefined )(status, body) ctx.status = status @@ -102882,33 +58484,101 @@ export function bootstrap( } ) - const teamsListPendingInvitationsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), + const activityDeleteRepoSubscriptionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "activityDeleteRepoSubscription", + "/repos/:owner/:repo/subscription", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityDeleteRepoSubscriptionParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.activityDeleteRepoSubscription(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListTagsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsListPendingInvitationsLegacyQuerySchema = z.object({ + const reposListTagsQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) + router.get("reposListTags", "/repos/:owner/:repo/tags", async (ctx, next) => { + const input = { + params: parseRequestInput(reposListTagsParamSchema, ctx.params), + query: parseRequestInput(reposListTagsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListTags(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + zipball_url: z.coerce.string(), + tarball_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const reposListTagProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + router.get( - "teamsListPendingInvitationsLegacy", - "/teams/:teamId/invitations", + "reposListTagProtection", + "/repos/:owner/:repo/tags/protection", async (ctx, next) => { const input = { params: parseRequestInput( - teamsListPendingInvitationsLegacyParamSchema, + reposListTagProtectionParamSchema, ctx.params ), - query: parseRequestInput( - teamsListPendingInvitationsLegacyQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } - const { status, body } = - await implementation.teamsListPendingInvitationsLegacy(input, ctx) + const { status, body } = await implementation.reposListTagProtection( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -102916,43 +58586,16 @@ export function bootstrap( "200", z.array( z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), }) ), ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -102961,73 +58604,38 @@ export function bootstrap( } ) - const teamsListMembersLegacyParamSchema = z.object({ - team_id: z.coerce.number(), + const reposCreateTagProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsListMembersLegacyQuerySchema = z.object({ - role: z.enum(["member", "maintainer", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposCreateTagProtectionBodySchema = z.object({ + pattern: z.coerce.string(), }) - router.get( - "teamsListMembersLegacy", - "/teams/:teamId/members", + router.post( + "reposCreateTagProtection", + "/repos/:owner/:repo/tags/protection", async (ctx, next) => { const input = { params: parseRequestInput( - teamsListMembersLegacyParamSchema, + reposCreateTagProtectionParamSchema, ctx.params ), - query: parseRequestInput(teamsListMembersLegacyQuerySchema, ctx.query), - body: undefined, + query: undefined, + body: parseRequestInput(reposCreateTagProtectionBodySchema, ctx.body), } - const { status, body } = await implementation.teamsListMembersLegacy( + const { status, body } = await implementation.reposCreateTagProtection( input, ctx ) ctx.body = responseValidationFactory( [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["201", s_tag_protection], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -103036,22 +58644,26 @@ export function bootstrap( } ) - const teamsGetMemberLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const reposDeleteTagProtectionParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + tag_protection_id: z.coerce.number(), }) - router.get( - "teamsGetMemberLegacy", - "/teams/:teamId/members/:username", + router.delete( + "reposDeleteTagProtection", + "/repos/:owner/:repo/tags/protection/:tagProtectionId", async (ctx, next) => { const input = { - params: parseRequestInput(teamsGetMemberLegacyParamSchema, ctx.params), + params: parseRequestInput( + reposDeleteTagProtectionParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsGetMemberLegacy( + const { status, body } = await implementation.reposDeleteTagProtection( input, ctx ) @@ -103059,7 +58671,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - ["404", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -103068,40 +58681,104 @@ export function bootstrap( } ) - const teamsAddMemberLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const reposDownloadTarballArchiveParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), }) - router.put( - "teamsAddMemberLegacy", - "/teams/:teamId/members/:username", + router.get( + "reposDownloadTarballArchive", + "/repos/:owner/:repo/tarball/:ref", async (ctx, next) => { const input = { - params: parseRequestInput(teamsAddMemberLegacyParamSchema, ctx.params), + params: parseRequestInput( + reposDownloadTarballArchiveParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsAddMemberLegacy( + const { status, body } = await implementation.reposDownloadTarballArchive( input, ctx ) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListTeamsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposListTeamsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "reposListTeams", + "/repos/:owner/:repo/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListTeamsParamSchema, ctx.params), + query: parseRequestInput(reposListTeamsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListTeams(input, ctx) + ctx.body = responseValidationFactory( [ - ["204", z.void()], [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), ], - ["404", z.void()], - ["422", z.void()], ], undefined )(status, body) @@ -103110,33 +58787,35 @@ export function bootstrap( } ) - const teamsRemoveMemberLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const reposGetAllTopicsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.delete( - "teamsRemoveMemberLegacy", - "/teams/:teamId/members/:username", + const reposGetAllTopicsQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + router.get( + "reposGetAllTopics", + "/repos/:owner/:repo/topics", async (ctx, next) => { const input = { - params: parseRequestInput( - teamsRemoveMemberLegacyParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(reposGetAllTopicsParamSchema, ctx.params), + query: parseRequestInput(reposGetAllTopicsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.teamsRemoveMemberLegacy( + const { status, body } = await implementation.reposGetAllTopics( input, ctx ) ctx.body = responseValidationFactory( [ - ["204", z.void()], - ["404", z.void()], + ["200", s_topic], + ["404", s_basic_error], ], undefined )(status, body) @@ -103145,46 +58824,35 @@ export function bootstrap( } ) - const teamsGetMembershipForUserLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const reposReplaceAllTopicsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.get( - "teamsGetMembershipForUserLegacy", - "/teams/:teamId/memberships/:username", + const reposReplaceAllTopicsBodySchema = z.object({ + names: z.array(z.coerce.string()), + }) + + router.put( + "reposReplaceAllTopics", + "/repos/:owner/:repo/topics", async (ctx, next) => { const input = { - params: parseRequestInput( - teamsGetMembershipForUserLegacyParamSchema, - ctx.params - ), + params: parseRequestInput(reposReplaceAllTopicsParamSchema, ctx.params), query: undefined, - body: undefined, + body: parseRequestInput(reposReplaceAllTopicsBodySchema, ctx.body), } - const { status, body } = - await implementation.teamsGetMembershipForUserLegacy(input, ctx) + const { status, body } = await implementation.reposReplaceAllTopics( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_topic], + ["404", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -103193,55 +58861,31 @@ export function bootstrap( } ) - const teamsAddOrUpdateMembershipForUserLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const reposGetClonesParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsAddOrUpdateMembershipForUserLegacyBodySchema = z - .object({ role: z.enum(["member", "maintainer"]).optional() }) - .optional() + const reposGetClonesQuerySchema = z.object({ + per: z.enum(["", "day", "week"]).optional(), + }) - router.put( - "teamsAddOrUpdateMembershipForUserLegacy", - "/teams/:teamId/memberships/:username", + router.get( + "reposGetClones", + "/repos/:owner/:repo/traffic/clones", async (ctx, next) => { const input = { - params: parseRequestInput( - teamsAddOrUpdateMembershipForUserLegacyParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - teamsAddOrUpdateMembershipForUserLegacyBodySchema, - ctx.body - ), + params: parseRequestInput(reposGetClonesParamSchema, ctx.params), + query: parseRequestInput(reposGetClonesQuerySchema, ctx.query), + body: undefined, } - const { status, body } = - await implementation.teamsAddOrUpdateMembershipForUserLegacy(input, ctx) + const { status, body } = await implementation.reposGetClones(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - url: z.coerce.string(), - role: z.enum(["member", "maintainer"]), - state: z.enum(["active", "pending"]), - }), - ], - ["403", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ["422", z.void()], + ["200", s_clone_traffic], + ["403", s_basic_error], ], undefined )(status, body) @@ -103250,31 +58894,37 @@ export function bootstrap( } ) - const teamsRemoveMembershipForUserLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - username: z.coerce.string(), + const reposGetTopPathsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - router.delete( - "teamsRemoveMembershipForUserLegacy", - "/teams/:teamId/memberships/:username", + router.get( + "reposGetTopPaths", + "/repos/:owner/:repo/traffic/popular/paths", async (ctx, next) => { const input = { - params: parseRequestInput( - teamsRemoveMembershipForUserLegacyParamSchema, - ctx.params - ), + params: parseRequestInput(reposGetTopPathsParamSchema, ctx.params), query: undefined, body: undefined, } - const { status, body } = - await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) + const { status, body } = await implementation.reposGetTopPaths(input, ctx) ctx.body = responseValidationFactory( [ - ["204", z.void()], - ["403", z.void()], + [ + "200", + z.array( + z.object({ + path: z.coerce.string(), + title: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), + }) + ), + ], + ["403", s_basic_error], ], undefined )(status, body) @@ -103283,29 +58933,22 @@ export function bootstrap( } ) - const teamsListProjectsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - }) - - const teamsListProjectsLegacyQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposGetTopReferrersParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.get( - "teamsListProjectsLegacy", - "/teams/:teamId/projects", + "reposGetTopReferrers", + "/repos/:owner/:repo/traffic/popular/referrers", async (ctx, next) => { const input = { - params: parseRequestInput( - teamsListProjectsLegacyParamSchema, - ctx.params - ), - query: parseRequestInput(teamsListProjectsLegacyQuerySchema, ctx.query), + params: parseRequestInput(reposGetTopReferrersParamSchema, ctx.params), + query: undefined, body: undefined, } - const { status, body } = await implementation.teamsListProjectsLegacy( + const { status, body } = await implementation.reposGetTopReferrers( input, ctx ) @@ -103316,60 +58959,46 @@ export function bootstrap( "200", z.array( z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), + referrer: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposGetViewsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposGetViewsQuerySchema = z.object({ + per: z.enum(["", "day", "week"]).optional(), + }) + + router.get( + "reposGetViews", + "/repos/:owner/:repo/traffic/views", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetViewsParamSchema, ctx.params), + query: parseRequestInput(reposGetViewsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetViews(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_view_traffic], + ["403", s_basic_error], ], undefined )(status, body) @@ -103378,18 +59007,50 @@ export function bootstrap( } ) - const teamsCheckPermissionsForProjectLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - project_id: z.coerce.number(), + const reposTransferParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposTransferBodySchema = z.object({ + new_owner: z.coerce.string(), + new_name: z.coerce.string().optional(), + team_ids: z.array(z.coerce.number()).optional(), + }) + + router.post( + "reposTransfer", + "/repos/:owner/:repo/transfer", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposTransferParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(reposTransferBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposTransfer(input, ctx) + + ctx.body = responseValidationFactory( + [["202", s_minimal_repository]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const reposCheckVulnerabilityAlertsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.get( - "teamsCheckPermissionsForProjectLegacy", - "/teams/:teamId/projects/:projectId", + "reposCheckVulnerabilityAlerts", + "/repos/:owner/:repo/vulnerability-alerts", async (ctx, next) => { const input = { params: parseRequestInput( - teamsCheckPermissionsForProjectLegacyParamSchema, + reposCheckVulnerabilityAlertsParamSchema, ctx.params ), query: undefined, @@ -103397,57 +59058,11 @@ export function bootstrap( } const { status, body } = - await implementation.teamsCheckPermissionsForProjectLegacy(input, ctx) + await implementation.reposCheckVulnerabilityAlerts(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), - }), - ], + ["204", z.void()], ["404", z.void()], ], undefined @@ -103457,413 +59072,162 @@ export function bootstrap( } ) - const teamsAddOrUpdateProjectPermissionsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - project_id: z.coerce.number(), + const reposEnableVulnerabilityAlertsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) - const teamsAddOrUpdateProjectPermissionsLegacyBodySchema = z - .object({ permission: z.enum(["read", "write", "admin"]).optional() }) - .optional() - router.put( - "teamsAddOrUpdateProjectPermissionsLegacy", - "/teams/:teamId/projects/:projectId", + "reposEnableVulnerabilityAlerts", + "/repos/:owner/:repo/vulnerability-alerts", async (ctx, next) => { const input = { params: parseRequestInput( - teamsAddOrUpdateProjectPermissionsLegacyParamSchema, + reposEnableVulnerabilityAlertsParamSchema, ctx.params ), query: undefined, - body: parseRequestInput( - teamsAddOrUpdateProjectPermissionsLegacyBodySchema, - ctx.body - ), + body: undefined, } const { status, body } = - await implementation.teamsAddOrUpdateProjectPermissionsLegacy( - input, - ctx - ) + await implementation.reposEnableVulnerabilityAlerts(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsRemoveProjectLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - project_id: z.coerce.number(), + const reposDisableVulnerabilityAlertsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), }) router.delete( - "teamsRemoveProjectLegacy", - "/teams/:teamId/projects/:projectId", + "reposDisableVulnerabilityAlerts", + "/repos/:owner/:repo/vulnerability-alerts", async (ctx, next) => { const input = { params: parseRequestInput( - teamsRemoveProjectLegacyParamSchema, + reposDisableVulnerabilityAlertsParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsRemoveProjectLegacy( - input, - ctx - ) + const { status, body } = + await implementation.reposDisableVulnerabilityAlerts(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsListReposLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - }) - - const teamsListReposLegacyQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const reposDownloadZipballArchiveParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + ref: z.coerce.string(), }) router.get( - "teamsListReposLegacy", - "/teams/:teamId/repos", + "reposDownloadZipballArchive", + "/repos/:owner/:repo/zipball/:ref", async (ctx, next) => { const input = { - params: parseRequestInput(teamsListReposLegacyParamSchema, ctx.params), - query: parseRequestInput(teamsListReposLegacyQuerySchema, ctx.query), + params: parseRequestInput( + reposDownloadZipballArchiveParamSchema, + ctx.params + ), + query: undefined, body: undefined, } - const { status, body } = await implementation.teamsListReposLegacy( + const { status, body } = await implementation.reposDownloadZipballArchive( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const teamsCheckPermissionsForRepoLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - owner: z.coerce.string(), - repo: z.coerce.string(), + const reposCreateUsingTemplateParamSchema = z.object({ + template_owner: z.coerce.string(), + template_repo: z.coerce.string(), }) - router.get( - "teamsCheckPermissionsForRepoLegacy", - "/teams/:teamId/repos/:owner/:repo", + const reposCreateUsingTemplateBodySchema = z.object({ + owner: z.coerce.string().optional(), + name: z.coerce.string(), + description: z.coerce.string().optional(), + include_all_branches: z.coerce.boolean().optional(), + private: z.coerce.boolean().optional(), + }) + + router.post( + "reposCreateUsingTemplate", + "/repos/:templateOwner/:templateRepo/generate", async (ctx, next) => { const input = { params: parseRequestInput( - teamsCheckPermissionsForRepoLegacyParamSchema, + reposCreateUsingTemplateParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput(reposCreateUsingTemplateBodySchema, ctx.body), } - const { status, body } = - await implementation.teamsCheckPermissionsForRepoLegacy(input, ctx) + const { status, body } = await implementation.reposCreateUsingTemplate( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), + ctx.body = responseValidationFactory([["201", s_repository]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListPublicQuerySchema = z.object({ + since: z.coerce.number().optional(), + }) + + router.get("reposListPublic", "/repositories", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(reposListPublicQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListPublic(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -103909,7 +59273,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -103921,7 +59285,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -103929,349 +59293,153 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - forks: z.coerce.number(), - permissions: z + secret_scanning: z .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + secret_scanning_push_protection: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const actionsListEnvironmentSecretsParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + }) + + const actionsListEnvironmentSecretsQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "actionsListEnvironmentSecrets", + "/repositories/:repositoryId/environments/:environmentName/secrets", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListEnvironmentSecretsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListEnvironmentSecretsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListEnvironmentSecrets(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), }), ], - ["204", z.void()], - ["404", z.void()], ], undefined )(status, body) @@ -104280,70 +59448,103 @@ export function bootstrap( } ) - const teamsAddOrUpdateRepoPermissionsLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - owner: z.coerce.string(), - repo: z.coerce.string(), + const actionsGetEnvironmentPublicKeyParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - const teamsAddOrUpdateRepoPermissionsLegacyBodySchema = z - .object({ permission: z.enum(["pull", "push", "admin"]).optional() }) - .optional() + router.get( + "actionsGetEnvironmentPublicKey", + "/repositories/:repositoryId/environments/:environmentName/secrets/public-key", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetEnvironmentPublicKeyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetEnvironmentPublicKey(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_actions_public_key]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetEnvironmentSecretParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + router.get( + "actionsGetEnvironmentSecret", + "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetEnvironmentSecretParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.actionsGetEnvironmentSecret( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_actions_secret]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsCreateOrUpdateEnvironmentSecretParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + secret_name: z.coerce.string(), + }) + + const actionsCreateOrUpdateEnvironmentSecretBodySchema = z.object({ + encrypted_value: z.coerce.string(), + key_id: z.coerce.string(), + }) router.put( - "teamsAddOrUpdateRepoPermissionsLegacy", - "/teams/:teamId/repos/:owner/:repo", + "actionsCreateOrUpdateEnvironmentSecret", + "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", async (ctx, next) => { const input = { params: parseRequestInput( - teamsAddOrUpdateRepoPermissionsLegacyParamSchema, + actionsCreateOrUpdateEnvironmentSecretParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - teamsAddOrUpdateRepoPermissionsLegacyBodySchema, + actionsCreateOrUpdateEnvironmentSecretBodySchema, ctx.body ), } const { status, body } = - await implementation.teamsAddOrUpdateRepoPermissionsLegacy(input, ctx) + await implementation.actionsCreateOrUpdateEnvironmentSecret(input, ctx) ctx.body = responseValidationFactory( [ + ["201", s_empty_object], ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], ], undefined )(status, body) @@ -104352,26 +59553,27 @@ export function bootstrap( } ) - const teamsRemoveRepoLegacyParamSchema = z.object({ - team_id: z.coerce.number(), - owner: z.coerce.string(), - repo: z.coerce.string(), + const actionsDeleteEnvironmentSecretParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + secret_name: z.coerce.string(), }) router.delete( - "teamsRemoveRepoLegacy", - "/teams/:teamId/repos/:owner/:repo", + "actionsDeleteEnvironmentSecret", + "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", async (ctx, next) => { const input = { - params: parseRequestInput(teamsRemoveRepoLegacyParamSchema, ctx.params), + params: parseRequestInput( + actionsDeleteEnvironmentSecretParamSchema, + ctx.params + ), query: undefined, body: undefined, } - const { status, body } = await implementation.teamsRemoveRepoLegacy( - input, - ctx - ) + const { status, body } = + await implementation.actionsDeleteEnvironmentSecret(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -104382,112 +59584,49 @@ export function bootstrap( } ) - const teamsListChildLegacyParamSchema = z.object({ - team_id: z.coerce.number(), + const actionsListEnvironmentVariablesParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), }) - const teamsListChildLegacyQuerySchema = z.object({ + const actionsListEnvironmentVariablesQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "teamsListChildLegacy", - "/teams/:teamId/teams", + "actionsListEnvironmentVariables", + "/repositories/:repositoryId/environments/:environmentName/variables", async (ctx, next) => { const input = { - params: parseRequestInput(teamsListChildLegacyParamSchema, ctx.params), - query: parseRequestInput(teamsListChildLegacyQuerySchema, ctx.query), + params: parseRequestInput( + actionsListEnvironmentVariablesParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListEnvironmentVariablesQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.teamsListChildLegacy( - input, - ctx - ) + const { status, body } = + await implementation.actionsListEnvironmentVariables(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), }), ], ], @@ -104498,289 +59637,378 @@ export function bootstrap( } ) - router.get("usersGetAuthenticated", "/user", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, + const actionsCreateEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + }) + + const actionsCreateEnvironmentVariableBodySchema = z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + }) + + router.post( + "actionsCreateEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsCreateEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsCreateEnvironmentVariableBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsCreateEnvironmentVariable(input, ctx) + + ctx.body = responseValidationFactory( + [["201", s_empty_object]], + undefined + )(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.usersGetAuthenticated( - input, - ctx - ) + const actionsGetEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), + }) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.union([ - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - private_gists: z.coerce.number(), - total_private_repos: z.coerce.number(), - owned_private_repos: z.coerce.number(), - disk_usage: z.coerce.number(), - collaborators: z.coerce.number(), - two_factor_authentication: z.coerce.boolean(), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - business_plus: z.coerce.boolean().optional(), - ldap_dn: z.coerce.string().optional(), - }), - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }), - ]), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() + router.get( + "actionsGetEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetEnvironmentVariable(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_actions_variable]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const actionsUpdateEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), }) - const usersUpdateAuthenticatedBodySchema = z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - twitter_username: z.coerce.string().optional(), - company: z.coerce.string().optional(), - location: z.coerce.string().optional(), - hireable: z.coerce.boolean().optional(), - bio: z.coerce.string().optional(), - }) - .optional() + const actionsUpdateEnvironmentVariableBodySchema = z.object({ + name: z.coerce.string().optional(), + value: z.coerce.string().optional(), + }) - router.patch("usersUpdateAuthenticated", "/user", async (ctx, next) => { + router.patch( + "actionsUpdateEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsUpdateEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsUpdateEnvironmentVariableBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsUpdateEnvironmentVariable(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsDeleteEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), + }) + + router.delete( + "actionsDeleteEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteEnvironmentVariable(input, ctx) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const searchCodeQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["indexed"]).optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("searchCode", "/search/code", async (ctx, next) => { const input = { params: undefined, - query: undefined, - body: parseRequestInput(usersUpdateAuthenticatedBodySchema, ctx.body), + query: parseRequestInput(searchCodeQuerySchema, ctx.query), + body: undefined, } - const { status, body } = await implementation.usersUpdateAuthenticated( - input, - ctx - ) + const { status, body } = await implementation.searchCode(input, ctx) ctx.body = responseValidationFactory( [ [ "200", z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - private_gists: z.coerce.number(), - total_private_repos: z.coerce.number(), - owned_private_repos: z.coerce.number(), - disk_usage: z.coerce.number(), - collaborators: z.coerce.number(), - two_factor_authentication: z.coerce.boolean(), - plan: z - .object({ - collaborators: z.coerce.number(), + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + file_size: z.coerce.number().optional(), + language: z.coerce.string().optional(), + last_modified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + line_numbers: z.array(z.coerce.string()).optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - business_plus: z.coerce.boolean().optional(), - ldap_dn: z.coerce.string().optional(), + ), }), ], ["304", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), }), ], ], @@ -104790,263 +60018,285 @@ export function bootstrap( return next() }) - const usersListBlockedByAuthenticatedUserQuerySchema = z.object({ + const searchCommitsQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["author-date", "committer-date"]).optional(), + order: z.enum(["desc", "asc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "usersListBlockedByAuthenticatedUser", - "/user/blocks", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - usersListBlockedByAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.usersListBlockedByAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const usersCheckBlockedParamSchema = z.object({ username: z.coerce.string() }) - - router.get( - "usersCheckBlocked", - "/user/blocks/:username", - async (ctx, next) => { - const input = { - params: parseRequestInput(usersCheckBlockedParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersCheckBlocked( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const usersBlockParamSchema = z.object({ username: z.coerce.string() }) - - router.put("usersBlock", "/user/blocks/:username", async (ctx, next) => { + router.get("searchCommits", "/search/commits", async (ctx, next) => { const input = { - params: parseRequestInput(usersBlockParamSchema, ctx.params), - query: undefined, + params: undefined, + query: parseRequestInput(searchCommitsQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.usersBlock(input, ctx) + const { status, body } = await implementation.searchCommits(input, ctx) ctx.body = responseValidationFactory( [ - ["204", z.void()], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], [ - "422", + "200", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + comment_count: z.coerce.number(), + message: z.coerce.string(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + url: z.coerce.string(), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + node_id: z.coerce.string(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), }), ], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const usersUnblockParamSchema = z.object({ username: z.coerce.string() }) - - router.delete("usersUnblock", "/user/blocks/:username", async (ctx, next) => { - const input = { - params: parseRequestInput(usersUnblockParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersUnblock(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], ], undefined )(status, body) @@ -105054,27 +60304,45 @@ export function bootstrap( return next() }) - const codespacesListForAuthenticatedUserQuerySchema = z.object({ + const searchIssuesAndPullRequestsQuerySchema = z.object({ + q: z.coerce.string(), + sort: z + .enum([ + "comments", + "reactions", + "reactions-+1", + "reactions--1", + "reactions-smile", + "reactions-thinking_face", + "reactions-heart", + "reactions-tada", + "interactions", + "created", + "updated", + ]) + .optional(), + order: z.enum(["desc", "asc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), }) router.get( - "codespacesListForAuthenticatedUser", - "/user/codespaces", + "searchIssuesAndPullRequests", + "/search/issues", async (ctx, next) => { const input = { params: undefined, query: parseRequestInput( - codespacesListForAuthenticatedUserQuerySchema, + searchIssuesAndPullRequestsQuerySchema, ctx.query ), body: undefined, } - const { status, body } = - await implementation.codespacesListForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.searchIssuesAndPullRequests( + input, + ctx + ) ctx.body = responseValidationFactory( [ @@ -105082,13 +60350,49 @@ export function bootstrap( "200", z.object({ total_count: z.coerce.number(), - codespaces: z.array( + incomplete_results: z.coerce.boolean(), + items: z.array( z.object({ + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ + node_id: z.coerce.string(), + number: z.coerce.number(), + title: z.coerce.string(), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -105111,7 +60415,20 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - billable_owner: z.object({ + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + description: z.coerce.string().optional(), + }) + ), + state: z.coerce.string(), + state_reason: z.coerce.string().optional(), + assignee: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -105134,284 +60451,477 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - repository: z.object({ + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + comments: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + body: z.coerce.string().optional(), + score: z.coerce.number(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + draft: z.coerce.boolean().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce - .string() - .optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) .optional(), - last_known_stop_notice: z.coerce.string().optional(), }) ), }), ], ["304", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], ], @@ -105422,105 +60932,102 @@ export function bootstrap( } ) - const codespacesCreateForAuthenticatedUserBodySchema = z.union([ - z.object({ - repository_id: z.coerce.number(), - ref: z.coerce.string().optional(), - location: z.coerce.string().optional(), - client_ip: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - multi_repo_permissions_opt_out: z.coerce.boolean().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - display_name: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - }), - z.object({ - pull_request: z.object({ - pull_request_number: z.coerce.number(), - repository_id: z.coerce.number(), - }), - location: z.coerce.string().optional(), - machine: z.coerce.string().optional(), - devcontainer_path: z.coerce.string().optional(), - working_directory: z.coerce.string().optional(), - idle_timeout_minutes: z.coerce.number().optional(), - }), - ]) + const searchLabelsQuerySchema = z.object({ + repository_id: z.coerce.number(), + q: z.coerce.string(), + sort: z.enum(["created", "updated"]).optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - router.post( - "codespacesCreateForAuthenticatedUser", - "/user/codespaces", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - codespacesCreateForAuthenticatedUserBodySchema, - ctx.body - ), - } + router.get("searchLabels", "/search/labels", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchLabelsQuerySchema, ctx.query), + body: undefined, + } - const { status, body } = - await implementation.codespacesCreateForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.searchLabels(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = responseValidationFactory( + [ [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + name: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + description: z.coerce.string(), + score: z.coerce.number(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const searchReposQuerySchema = z.object({ + q: z.coerce.string(), + sort: z + .enum(["stars", "forks", "help-wanted-issues", "updated"]) + .optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("searchRepos", "/search/repositories", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchReposQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.searchRepos(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), @@ -105553,267 +61060,456 @@ export function bootstrap( description: z.coerce.string(), fork: z.coerce.boolean(), url: z.coerce.string(), - archive_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + pushed_at: z.coerce.string().datetime({ offset: true }), + homepage: z.coerce.string(), + size: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + open_issues_count: z.coerce.number(), + master_branch: z.coerce.string().optional(), + default_branch: z.coerce.string(), + score: z.coerce.number(), + forks_url: z.coerce.string(), + keys_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + teams_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + events_url: z.coerce.string(), assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), + tags_url: z.coerce.string(), + blobs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + trees_url: z.coerce.string(), + statuses_url: z.coerce.string(), + languages_url: z.coerce.string(), + stargazers_url: z.coerce.string(), contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + commits_url: z.coerce.string(), git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), + comments_url: z.coerce.string(), issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), + contents_url: z.coerce.string(), + compare_url: z.coerce.string(), merges_url: z.coerce.string(), + archive_url: z.coerce.string(), + downloads_url: z.coerce.string(), + issues_url: z.coerce.string(), + pulls_url: z.coerce.string(), milestones_url: z.coerce.string(), notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), + labels_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), + deployments_url: z.coerce.string(), + git_url: z.coerce.string(), + ssh_url: z.coerce.string(), + clone_url: z.coerce.string(), + svn_url: z.coerce.string(), + forks: z.coerce.number(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), + mirror_url: z.coerce.string(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), permissions: z .object({ - admin: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), + push: z.coerce.boolean(), triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), }) .optional(), - role_name: z.coerce.string().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ + }) + ), + }), + ], + ["304", z.void()], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const searchTopicsQuerySchema = z.object({ + q: z.coerce.string(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("searchTopics", "/search/topics", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchTopicsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.searchTopics(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ name: z.coerce.string(), display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], + short_description: z.coerce.string(), + description: z.coerce.string(), + created_by: z.coerce.string(), + released: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + featured: z.coerce.boolean(), + curated: z.coerce.boolean(), + score: z.coerce.number(), + repository_count: z.coerce.number().optional(), + logo_url: z.coerce.string().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + related: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + aliases: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const searchUsersQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["followers", "repositories", "joined"]).optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get("searchUsers", "/search/users", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchUsersQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.searchUsers(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + score: z.coerce.number(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + events_url: z.coerce.string(), + public_repos: z.coerce.number().optional(), + public_gists: z.coerce.number().optional(), + followers: z.coerce.number().optional(), + following: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + name: z.coerce.string().optional(), + bio: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + location: z.coerce.string().optional(), + site_admin: z.coerce.boolean(), + hireable: z.coerce.boolean().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + blog: z.coerce.string().optional(), + company: z.coerce.string().optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const teamsGetLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + + router.get("teamsGetLegacy", "/teams/:teamId", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsGetLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsGetLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_team_full], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const teamsUpdateLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + + const teamsUpdateLegacyBodySchema = z.object({ + name: z.coerce.string(), + description: z.coerce.string().optional(), + privacy: z.enum(["secret", "closed"]).optional(), + permission: z.enum(["pull", "push", "admin"]).optional(), + parent_team_id: z.coerce.number().optional(), + }) + + router.patch("teamsUpdateLegacy", "/teams/:teamId", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsUpdateLegacyParamSchema, ctx.params), + query: undefined, + body: parseRequestInput(teamsUpdateLegacyBodySchema, ctx.body), + } + + const { status, body } = await implementation.teamsUpdateLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_team_full], + ["201", s_team_full], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const teamsDeleteLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + + router.delete("teamsDeleteLegacy", "/teams/:teamId", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsDeleteLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsDeleteLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const teamsListDiscussionsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListDiscussionsLegacyQuerySchema = z.object({ + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "teamsListDiscussionsLegacy", + "/teams/:teamId/discussions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsListDiscussionsLegacyParamSchema, + ctx.params + ), + query: parseRequestInput( + teamsListDiscussionsLegacyQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.teamsListDiscussionsLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ [ - "202", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + "200", + z.array( + z.object({ + author: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -105836,247 +61532,38 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + reactions: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), + }) + ), ], ], undefined @@ -106086,46 +61573,238 @@ export function bootstrap( } ) - const codespacesListSecretsForAuthenticatedUserQuerySchema = z.object({ + const teamsCreateDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsCreateDiscussionLegacyBodySchema = z.object({ + title: z.coerce.string(), + body: z.coerce.string(), + private: z.coerce.boolean().optional(), + }) + + router.post( + "teamsCreateDiscussionLegacy", + "/teams/:teamId/discussions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCreateDiscussionLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsCreateDiscussionLegacyBodySchema, + ctx.body + ), + } + + const { status, body } = await implementation.teamsCreateDiscussionLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["201", s_team_discussion]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsGetDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + router.get( + "teamsGetDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsGetDiscussionLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsGetDiscussionLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_team_discussion]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsUpdateDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + const teamsUpdateDiscussionLegacyBodySchema = z + .object({ + title: z.coerce.string().optional(), + body: z.coerce.string().optional(), + }) + .optional() + + router.patch( + "teamsUpdateDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsUpdateDiscussionLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsUpdateDiscussionLegacyBodySchema, + ctx.body + ), + } + + const { status, body } = await implementation.teamsUpdateDiscussionLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_team_discussion]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsDeleteDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + router.delete( + "teamsDeleteDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsDeleteDiscussionLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsDeleteDiscussionLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const teamsListDiscussionCommentsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + const teamsListDiscussionCommentsLegacyQuerySchema = z.object({ + direction: z.enum(["asc", "desc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) router.get( - "codespacesListSecretsForAuthenticatedUser", - "/user/codespaces/secrets", + "teamsListDiscussionCommentsLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + teamsListDiscussionCommentsLegacyParamSchema, + ctx.params + ), query: parseRequestInput( - codespacesListSecretsForAuthenticatedUserQuerySchema, + teamsListDiscussionCommentsLegacyQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.codespacesListSecretsForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsListDiscussionCommentsLegacy(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string(), - }) - ), - }), + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), ], ], undefined @@ -106135,29 +61814,36 @@ export function bootstrap( } ) - router.get( - "codespacesGetPublicKeyForAuthenticatedUser", - "/user/codespaces/secrets/public-key", + const teamsCreateDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + const teamsCreateDiscussionCommentLegacyBodySchema = z.object({ + body: z.coerce.string(), + }) + + router.post( + "teamsCreateDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + teamsCreateDiscussionCommentLegacyParamSchema, + ctx.params + ), query: undefined, - body: undefined, + body: parseRequestInput( + teamsCreateDiscussionCommentLegacyBodySchema, + ctx.body + ), } const { status, body } = - await implementation.codespacesGetPublicKeyForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsCreateDiscussionCommentLegacy(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ key_id: z.coerce.string(), key: z.coerce.string() }), - ], - ], + [["201", s_team_discussion_comment]], undefined )(status, body) ctx.status = status @@ -106165,17 +61851,19 @@ export function bootstrap( } ) - const codespacesGetSecretForAuthenticatedUserParamSchema = z.object({ - secret_name: z.coerce.string(), + const teamsGetDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), }) router.get( - "codespacesGetSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", + "teamsGetDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesGetSecretForAuthenticatedUserParamSchema, + teamsGetDiscussionCommentLegacyParamSchema, ctx.params ), query: undefined, @@ -106183,21 +61871,10 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesGetSecretForAuthenticatedUser(input, ctx) + await implementation.teamsGetDiscussionCommentLegacy(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string(), - }), - ], - ], + [["200", s_team_discussion_comment]], undefined )(status, body) ctx.status = status @@ -106205,76 +61882,37 @@ export function bootstrap( } ) - const codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + const teamsUpdateDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), + }) - const codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema = z.object( - { - encrypted_value: z.coerce.string().optional(), - key_id: z.coerce.string(), - selected_repository_ids: z.array(z.coerce.string()).optional(), - } - ) + const teamsUpdateDiscussionCommentLegacyBodySchema = z.object({ + body: z.coerce.string(), + }) - router.put( - "codespacesCreateOrUpdateSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", + router.patch( + "teamsUpdateDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema, + teamsUpdateDiscussionCommentLegacyParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema, + teamsUpdateDiscussionCommentLegacyBodySchema, ctx.body ), } const { status, body } = - await implementation.codespacesCreateOrUpdateSecretForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsUpdateDiscussionCommentLegacy(input, ctx) ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - ["204", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - ], + [["200", s_team_discussion_comment]], undefined )(status, body) ctx.status = status @@ -106282,17 +61920,19 @@ export function bootstrap( } ) - const codespacesDeleteSecretForAuthenticatedUserParamSchema = z.object({ - secret_name: z.coerce.string(), + const teamsDeleteDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), }) router.delete( - "codespacesDeleteSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", + "teamsDeleteDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesDeleteSecretForAuthenticatedUserParamSchema, + teamsDeleteDiscussionCommentLegacyParamSchema, ctx.params ), query: undefined, @@ -106300,10 +61940,7 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesDeleteSecretForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) ctx.body = responseValidationFactory([["204", z.void()]], undefined)( status, @@ -106314,24 +61951,47 @@ export function bootstrap( } ) - const codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + const reactionsListForTeamDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), + }) + + const reactionsListForTeamDiscussionCommentLegacyQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) router.get( - "codespacesListRepositoriesForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories", + "reactionsListForTeamDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema, + reactionsListForTeamDiscussionCommentLegacyParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + reactionsListForTeamDiscussionCommentLegacyQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.codespacesListRepositoriesForSecretForAuthenticatedUser( + await implementation.reactionsListForTeamDiscussionCommentLegacy( input, ctx ) @@ -106340,209 +62000,46 @@ export function bootstrap( [ [ "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], ], undefined @@ -106552,144 +62049,141 @@ export function bootstrap( } ) - const codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + const reactionsCreateForTeamDiscussionCommentLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + comment_number: z.coerce.number(), + }) - const codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema = - z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + const reactionsCreateForTeamDiscussionCommentLegacyBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + }) - router.put( - "codespacesSetRepositoriesForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories", + router.post( + "reactionsCreateForTeamDiscussionCommentLegacy", + "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema, + reactionsCreateForTeamDiscussionCommentLegacyParamSchema, ctx.params ), query: undefined, body: parseRequestInput( - codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema, + reactionsCreateForTeamDiscussionCommentLegacyBodySchema, ctx.body ), } const { status, body } = - await implementation.codespacesSetRepositoriesForSecretForAuthenticatedUser( + await implementation.reactionsCreateForTeamDiscussionCommentLegacy( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["201", s_reaction]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema = - z.object({ - secret_name: z.coerce.string(), - repository_id: z.coerce.number(), - }) + const reactionsListForTeamDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) + + const reactionsListForTeamDiscussionLegacyQuerySchema = z.object({ + content: z + .enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]) + .optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - router.put( - "codespacesAddRepositoryForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + router.get( + "reactionsListForTeamDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema, + reactionsListForTeamDiscussionLegacyParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + reactionsListForTeamDiscussionLegacyQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.codespacesAddRepositoryForSecretForAuthenticatedUser( - input, - ctx - ) + await implementation.reactionsListForTeamDiscussionLegacy(input, ctx) ctx.body = responseValidationFactory( [ - ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], ], undefined @@ -106699,159 +62193,94 @@ export function bootstrap( } ) - const codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema = - z.object({ - secret_name: z.coerce.string(), - repository_id: z.coerce.number(), - }) + const reactionsCreateForTeamDiscussionLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + discussion_number: z.coerce.number(), + }) - router.delete( - "codespacesRemoveRepositoryForSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + const reactionsCreateForTeamDiscussionLegacyBodySchema = z.object({ + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + }) + + router.post( + "reactionsCreateForTeamDiscussionLegacy", + "/teams/:teamId/discussions/:discussionNumber/reactions", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema, + reactionsCreateForTeamDiscussionLegacyParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + reactionsCreateForTeamDiscussionLegacyBodySchema, + ctx.body + ), } const { status, body } = - await implementation.codespacesRemoveRepositoryForSecretForAuthenticatedUser( - input, - ctx - ) + await implementation.reactionsCreateForTeamDiscussionLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["201", s_reaction]], undefined)( + status, + body + ) ctx.status = status return next() } ) - const codespacesGetForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsListPendingInvitationsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListPendingInvitationsLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) router.get( - "codespacesGetForAuthenticatedUser", - "/user/codespaces/:codespaceName", + "teamsListPendingInvitationsLegacy", + "/teams/:teamId/invitations", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesGetForAuthenticatedUserParamSchema, + teamsListPendingInvitationsLegacyParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + teamsListPendingInvitationsLegacyQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.codespacesGetForAuthenticatedUser(input, ctx) + await implementation.teamsListPendingInvitationsLegacy(input, ctx) ctx.body = responseValidationFactory( [ [ "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + z.array( + z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -106874,249 +62303,12 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), ], ], undefined @@ -107126,70 +62318,40 @@ export function bootstrap( } ) - const codespacesUpdateForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsListMembersLegacyParamSchema = z.object({ + team_id: z.coerce.number(), }) - const codespacesUpdateForAuthenticatedUserBodySchema = z - .object({ - machine: z.coerce.string().optional(), - display_name: z.coerce.string().optional(), - recent_folders: z.array(z.coerce.string()).optional(), - }) - .optional() + const teamsListMembersLegacyQuerySchema = z.object({ + role: z.enum(["member", "maintainer", "all"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - router.patch( - "codespacesUpdateForAuthenticatedUser", - "/user/codespaces/:codespaceName", + router.get( + "teamsListMembersLegacy", + "/teams/:teamId/members", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesUpdateForAuthenticatedUserParamSchema, + teamsListMembersLegacyParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - codespacesUpdateForAuthenticatedUserBodySchema, - ctx.body - ), + query: parseRequestInput(teamsListMembersLegacyQuerySchema, ctx.query), + body: undefined, } - const { status, body } = - await implementation.codespacesUpdateForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.teamsListMembersLegacy( + input, + ctx + ) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ + [ + "200", + z.array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -107211,269 +62373,10 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), + }) + ), ], + ["404", s_basic_error], ], undefined )(status, body) @@ -107482,66 +62385,99 @@ export function bootstrap( } ) - const codespacesDeleteForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsGetMemberLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) + + router.get( + "teamsGetMemberLegacy", + "/teams/:teamId/members/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsGetMemberLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsGetMemberLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsAddMemberLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), + }) + + router.put( + "teamsAddMemberLegacy", + "/teams/:teamId/members/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsAddMemberLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsAddMemberLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", z.void()], + ["422", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsRemoveMemberLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), }) router.delete( - "codespacesDeleteForAuthenticatedUser", - "/user/codespaces/:codespaceName", + "teamsRemoveMemberLegacy", + "/teams/:teamId/members/:username", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesDeleteForAuthenticatedUserParamSchema, + teamsRemoveMemberLegacyParamSchema, ctx.params ), query: undefined, body: undefined, } - const { status, body } = - await implementation.codespacesDeleteForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.teamsRemoveMemberLegacy( + input, + ctx + ) ctx.body = responseValidationFactory( [ - ["202", z.object({})], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["204", z.void()], + ["404", z.void()], ], undefined )(status, body) @@ -107550,17 +62486,18 @@ export function bootstrap( } ) - const codespacesExportForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsGetMembershipForUserLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), }) - router.post( - "codespacesExportForAuthenticatedUser", - "/user/codespaces/:codespaceName/exports", + router.get( + "teamsGetMembershipForUserLegacy", + "/teams/:teamId/memberships/:username", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesExportForAuthenticatedUserParamSchema, + teamsGetMembershipForUserLegacyParamSchema, ctx.params ), query: undefined, @@ -107568,84 +62505,12 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesExportForAuthenticatedUser(input, ctx) + await implementation.teamsGetMembershipForUserLegacy(input, ctx) ctx.body = responseValidationFactory( [ - [ - "202", - z.object({ - state: z.coerce.string().optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - branch: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - id: z.coerce.string().optional(), - export_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_team_membership], + ["404", s_basic_error], ], undefined )(status, body) @@ -107654,56 +62519,40 @@ export function bootstrap( } ) - const codespacesGetExportDetailsForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), - export_id: z.coerce.string(), + const teamsAddOrUpdateMembershipForUserLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), }) - router.get( - "codespacesGetExportDetailsForAuthenticatedUser", - "/user/codespaces/:codespaceName/exports/:exportId", + const teamsAddOrUpdateMembershipForUserLegacyBodySchema = z + .object({ role: z.enum(["member", "maintainer"]).optional() }) + .optional() + + router.put( + "teamsAddOrUpdateMembershipForUserLegacy", + "/teams/:teamId/memberships/:username", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesGetExportDetailsForAuthenticatedUserParamSchema, + teamsAddOrUpdateMembershipForUserLegacyParamSchema, ctx.params ), query: undefined, - body: undefined, + body: parseRequestInput( + teamsAddOrUpdateMembershipForUserLegacyBodySchema, + ctx.body + ), } const { status, body } = - await implementation.codespacesGetExportDetailsForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsAddOrUpdateMembershipForUserLegacy(input, ctx) ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - state: z.coerce.string().optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - branch: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - id: z.coerce.string().optional(), - export_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_team_membership], + ["403", z.void()], + ["404", s_basic_error], + ["422", z.void()], ], undefined )(status, body) @@ -107712,17 +62561,18 @@ export function bootstrap( } ) - const codespacesCodespaceMachinesForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsRemoveMembershipForUserLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + username: z.coerce.string(), }) - router.get( - "codespacesCodespaceMachinesForAuthenticatedUser", - "/user/codespaces/:codespaceName/machines", + router.delete( + "teamsRemoveMembershipForUserLegacy", + "/teams/:teamId/memberships/:username", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesCodespaceMachinesForAuthenticatedUserParamSchema, + teamsRemoveMembershipForUserLegacyParamSchema, ctx.params ), query: undefined, @@ -107730,71 +62580,12 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesCodespaceMachinesForAuthenticatedUser( - input, - ctx - ) + await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - machines: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }) - ), - }), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", z.void()], ], undefined )(status, body) @@ -107803,95 +62594,50 @@ export function bootstrap( } ) - const codespacesPublishForAuthenticatedUserParamSchema = z.object({ - codespace_name: z.coerce.string(), + const teamsListProjectsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), }) - const codespacesPublishForAuthenticatedUserBodySchema = z.object({ - name: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), + const teamsListProjectsLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.post( - "codespacesPublishForAuthenticatedUser", - "/user/codespaces/:codespaceName/publish", + router.get( + "teamsListProjectsLegacy", + "/teams/:teamId/projects", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesPublishForAuthenticatedUserParamSchema, + teamsListProjectsLegacyParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - codespacesPublishForAuthenticatedUserBodySchema, - ctx.body - ), + query: parseRequestInput(teamsListProjectsLegacyQuerySchema, ctx.query), + body: undefined, } - const { status, body } = - await implementation.codespacesPublishForAuthenticatedUser(input, ctx) + const { status, body } = await implementation.teamsListProjectsLegacy( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ + columns_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -107914,795 +62660,830 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number(), - network_count: z.coerce.number(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCheckPermissionsForProjectLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + project_id: z.coerce.number(), + }) + + router.get( + "teamsCheckPermissionsForProjectLegacy", + "/teams/:teamId/projects/:projectId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCheckPermissionsForProjectLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.teamsCheckPermissionsForProjectLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_team_project], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsAddOrUpdateProjectPermissionsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + project_id: z.coerce.number(), + }) + + const teamsAddOrUpdateProjectPermissionsLegacyBodySchema = z + .object({ permission: z.enum(["read", "write", "admin"]).optional() }) + .optional() + + router.put( + "teamsAddOrUpdateProjectPermissionsLegacy", + "/teams/:teamId/projects/:projectId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsAddOrUpdateProjectPermissionsLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsAddOrUpdateProjectPermissionsLegacyBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.teamsAddOrUpdateProjectPermissionsLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsRemoveProjectLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + project_id: z.coerce.number(), + }) + + router.delete( + "teamsRemoveProjectLegacy", + "/teams/:teamId/projects/:projectId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsRemoveProjectLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsRemoveProjectLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsListReposLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListReposLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "teamsListReposLegacy", + "/teams/:teamId/repos", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsListReposLegacyParamSchema, ctx.params), + query: parseRequestInput(teamsListReposLegacyQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.teamsListReposLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - parent: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsCheckPermissionsForRepoLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.get( + "teamsCheckPermissionsForRepoLegacy", + "/teams/:teamId/repos/:owner/:repo", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsCheckPermissionsForRepoLegacyParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.teamsCheckPermissionsForRepoLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_team_repository], + ["204", z.void()], + ["404", z.void()], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsAddOrUpdateRepoPermissionsLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const teamsAddOrUpdateRepoPermissionsLegacyBodySchema = z + .object({ permission: z.enum(["pull", "push", "admin"]).optional() }) + .optional() + + router.put( + "teamsAddOrUpdateRepoPermissionsLegacy", + "/teams/:teamId/repos/:owner/:repo", + async (ctx, next) => { + const input = { + params: parseRequestInput( + teamsAddOrUpdateRepoPermissionsLegacyParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + teamsAddOrUpdateRepoPermissionsLegacyBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.teamsAddOrUpdateRepoPermissionsLegacy(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const teamsRemoveRepoLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + router.delete( + "teamsRemoveRepoLegacy", + "/teams/:teamId/repos/:owner/:repo", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsRemoveRepoLegacyParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.teamsRemoveRepoLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const teamsListChildLegacyParamSchema = z.object({ + team_id: z.coerce.number(), + }) + + const teamsListChildLegacyQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "teamsListChildLegacy", + "/teams/:teamId/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput(teamsListChildLegacyParamSchema, ctx.params), + query: parseRequestInput(teamsListChildLegacyQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.teamsListChildLegacy( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + router.get("usersGetAuthenticated", "/user", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.usersGetAuthenticated( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", z.union([s_private_user, s_public_user])], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const usersUpdateAuthenticatedBodySchema = z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + twitter_username: z.coerce.string().optional(), + company: z.coerce.string().optional(), + location: z.coerce.string().optional(), + hireable: z.coerce.boolean().optional(), + bio: z.coerce.string().optional(), + }) + .optional() + + router.patch("usersUpdateAuthenticated", "/user", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput(usersUpdateAuthenticatedBodySchema, ctx.body), + } + + const { status, body } = await implementation.usersUpdateAuthenticated( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_private_user], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const usersListBlockedByAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "usersListBlockedByAuthenticatedUser", + "/user/blocks", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + usersListBlockedByAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.usersListBlockedByAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersCheckBlockedParamSchema = z.object({ username: z.coerce.string() }) + + router.get( + "usersCheckBlocked", + "/user/blocks/:username", + async (ctx, next) => { + const input = { + params: parseRequestInput(usersCheckBlockedParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.usersCheckBlocked( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const usersBlockParamSchema = z.object({ username: z.coerce.string() }) + + router.put("usersBlock", "/user/blocks/:username", async (ctx, next) => { + const input = { + params: parseRequestInput(usersBlockParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.usersBlock(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const usersUnblockParamSchema = z.object({ username: z.coerce.string() }) + + router.delete("usersUnblock", "/user/blocks/:username", async (ctx, next) => { + const input = { + params: parseRequestInput(usersUnblockParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.usersUnblock(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + }) + + const codespacesListForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + }) + + router.get( + "codespacesListForAuthenticatedUser", + "/user/codespaces", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + codespacesListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesListForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - source: z - .object({ + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -108748,7 +63529,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -108760,7 +63541,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -108768,350 +63549,761 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), + role_name: z.coerce.string().optional(), temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - forks: z.coerce.number(), - master_branch: z.coerce.string().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - anonymous_access_enabled: z.coerce.boolean().optional(), - code_of_conduct: z - .object({ - url: z.coerce.string(), - key: z.coerce.string(), - name: z.coerce.string(), - html_url: z.coerce.string(), - }) - .optional(), - security_and_analysis: z - .object({ - advanced_security: z + code_of_conduct: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), }) .optional(), - secret_scanning: z + license: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), }) .optional(), - secret_scanning_push_protection: z + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), }) .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce + .string() + .optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), + last_known_stop_notice: z.coerce.string().optional(), }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), + ), }), ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateForAuthenticatedUserBodySchema = z.union([ + z.object({ + repository_id: z.coerce.number(), + ref: z.coerce.string().optional(), + location: z.coerce.string().optional(), + client_ip: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + multi_repo_permissions_opt_out: z.coerce.boolean().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + display_name: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + }), + z.object({ + pull_request: z.object({ + pull_request_number: z.coerce.number(), + repository_id: z.coerce.number(), + }), + location: z.coerce.string().optional(), + machine: z.coerce.string().optional(), + devcontainer_path: z.coerce.string().optional(), + working_directory: z.coerce.string().optional(), + idle_timeout_minutes: z.coerce.number().optional(), + }), + ]) + + router.post( + "codespacesCreateForAuthenticatedUser", + "/user/codespaces", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + codespacesCreateForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_codespace], + ["202", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], [ - "403", + "503", z.object({ + code: z.coerce.string().optional(), message: z.coerce.string().optional(), documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), }), ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesListSecretsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + router.get( + "codespacesListSecretsForAuthenticatedUser", + "/user/codespaces/secrets", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + codespacesListSecretsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesListSecretsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ [ - "404", + "200", z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), + }) + ), }), ], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + router.get( + "codespacesGetPublicKeyForAuthenticatedUser", + "/user/codespaces/secrets/public-key", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetPublicKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [["200", s_codespaces_user_public_key]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesGetSecretForAuthenticatedUserParamSchema = z.object({ + secret_name: z.coerce.string(), + }) + + router.get( + "codespacesGetSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetSecretForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [["200", s_codespaces_secret]], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) + + const codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema = z.object( + { + encrypted_value: z.coerce.string().optional(), + key_id: z.coerce.string(), + selected_repository_ids: z.array(z.coerce.string()).optional(), + } + ) + + router.put( + "codespacesCreateOrUpdateSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCreateOrUpdateSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesCreateOrUpdateSecretForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesCreateOrUpdateSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesDeleteSecretForAuthenticatedUserParamSchema = z.object({ + secret_name: z.coerce.string(), + }) + + router.delete( + "codespacesDeleteSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesDeleteSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesDeleteSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + status, + body + ) + ctx.status = status + return next() + } + ) + + const codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) + + router.get( + "codespacesListRepositoriesForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesListRepositoriesForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ [ - "422", + "200", z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), }), ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) + + const codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema = + z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + + router.put( + "codespacesSetRepositoriesForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesSetRepositoriesForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesSetRepositoriesForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema = + z.object({ + secret_name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.put( + "codespacesAddRepositoryForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesAddRepositoryForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesAddRepositoryForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema = + z.object({ + secret_name: z.coerce.string(), + repository_id: z.coerce.number(), + }) + + router.delete( + "codespacesRemoveRepositoryForSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName/repositories/:repositoryId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesRemoveRepositoryForSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesRemoveRepositoryForSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -109120,17 +64312,134 @@ export function bootstrap( } ) - const codespacesStartForAuthenticatedUserParamSchema = z.object({ + const codespacesGetForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + router.get( + "codespacesGetForAuthenticatedUser", + "/user/codespaces/:codespaceName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_codespace], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesUpdateForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + const codespacesUpdateForAuthenticatedUserBodySchema = z + .object({ + machine: z.coerce.string().optional(), + display_name: z.coerce.string().optional(), + recent_folders: z.array(z.coerce.string()).optional(), + }) + .optional() + + router.patch( + "codespacesUpdateForAuthenticatedUser", + "/user/codespaces/:codespaceName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesUpdateForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesUpdateForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesUpdateForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesDeleteForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + router.delete( + "codespacesDeleteForAuthenticatedUser", + "/user/codespaces/:codespaceName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesDeleteForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesDeleteForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["202", z.object({})], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesExportForAuthenticatedUserParamSchema = z.object({ codespace_name: z.coerce.string(), }) router.post( - "codespacesStartForAuthenticatedUser", - "/user/codespaces/:codespaceName/start", + "codespacesExportForAuthenticatedUser", + "/user/codespaces/:codespaceName/exports", async (ctx, next) => { const input = { params: parseRequestInput( - codespacesStartForAuthenticatedUserParamSchema, + codespacesExportForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -109138,364 +64447,193 @@ export function bootstrap( } const { status, body } = - await implementation.codespacesStartForAuthenticatedUser(input, ctx) + await implementation.codespacesExportForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["202", s_codespace_export_details], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesGetExportDetailsForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + export_id: z.coerce.string(), + }) + + router.get( + "codespacesGetExportDetailsForAuthenticatedUser", + "/user/codespaces/:codespaceName/exports/:exportId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetExportDetailsForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetExportDetailsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_codespace_export_details], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesCodespaceMachinesForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + router.get( + "codespacesCodespaceMachinesForAuthenticatedUser", + "/user/codespaces/:codespaceName/machines", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesCodespaceMachinesForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesCodespaceMachinesForAuthenticatedUser( + input, + ctx + ) ctx.body = responseValidationFactory( [ [ "200", z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), + total_count: z.coerce.number(), + machines: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), + ), }), ], ["304", z.void()], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "402", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesPublishForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + const codespacesPublishForAuthenticatedUserBodySchema = z.object({ + name: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + }) + + router.post( + "codespacesPublishForAuthenticatedUser", + "/user/codespaces/:codespaceName/publish", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesPublishForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + codespacesPublishForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.codespacesPublishForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_codespace_with_full_repository], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const codespacesStartForAuthenticatedUserParamSchema = z.object({ + codespace_name: z.coerce.string(), + }) + + router.post( + "codespacesStartForAuthenticatedUser", + "/user/codespaces/:codespaceName/start", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesStartForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesStartForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["200", s_codespace], + ["304", z.void()], + ["400", s_scim_error], + ["401", s_basic_error], + ["402", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -109526,330 +64664,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum(["none", "ready", "in_progress"]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce.string().optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "500", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], ], undefined )(status, body) @@ -109895,56 +64714,10 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -109988,33 +64761,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -110059,56 +64808,10 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -110143,56 +64846,10 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -110253,24 +64910,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -110331,24 +64972,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -110384,33 +65009,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -110434,33 +65035,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -110486,33 +65063,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -110589,33 +65142,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -110647,99 +65176,12 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }), - ], + ["201", s_gpg_key], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -110770,76 +65212,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }), - ], + ["200", s_gpg_key], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -110872,56 +65249,10 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -111061,24 +65392,8 @@ export function bootstrap( }), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -111429,24 +65744,8 @@ export function bootstrap( }), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -111483,24 +65782,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -111538,24 +65821,8 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -111592,16 +65859,8 @@ export function bootstrap( } ) - const interactionsSetRestrictionsForAuthenticatedUserBodySchema = z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - expiry: z - .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) - .optional(), - }) + const interactionsSetRestrictionsForAuthenticatedUserBodySchema = + s_interaction_limit router.put( "interactionsSetRestrictionsForAuthenticatedUser", @@ -111624,41 +65883,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - limit: z.enum([ - "existing_users", - "contributors_only", - "collaborators_only", - ]), - origin: z.coerce.string(), - expires_at: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_interaction_limit_response], + ["422", s_validation_error], ], undefined )(status, body) @@ -112296,15 +66522,7 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -112354,33 +66572,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -112415,69 +66609,12 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - url: z.coerce.string(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - verified: z.coerce.boolean(), - read_only: z.coerce.boolean(), - }), - ], + ["201", s_key], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -112511,46 +66648,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - url: z.coerce.string(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - verified: z.coerce.boolean(), - read_only: z.coerce.boolean(), - }), - ], + ["200", s_key], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -112586,33 +66688,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -112690,24 +66768,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -112785,15 +66847,7 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], ], undefined )(status, body) @@ -112878,47 +66932,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -112948,204 +66964,54 @@ export function bootstrap( await implementation.orgsGetMembershipForAuthenticatedUser(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsUpdateMembershipForAuthenticatedUserParamSchema = z.object({ - org: z.coerce.string(), - }) - - const orgsUpdateMembershipForAuthenticatedUserBodySchema = z.object({ - state: z.enum(["active"]), - }) - - router.patch( - "orgsUpdateMembershipForAuthenticatedUser", - "/user/memberships/orgs/:org", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsUpdateMembershipForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - orgsUpdateMembershipForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.orgsUpdateMembershipForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const orgsUpdateMembershipForAuthenticatedUserParamSchema = z.object({ + org: z.coerce.string(), + }) + + const orgsUpdateMembershipForAuthenticatedUserBodySchema = z.object({ + state: z.enum(["active"]), + }) + + router.patch( + "orgsUpdateMembershipForAuthenticatedUser", + "/user/memberships/orgs/:org", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsUpdateMembershipForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + orgsUpdateMembershipForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.orgsUpdateMembershipForAuthenticatedUser( + input, + ctx + ) + + ctx.body = responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -113471,505 +67337,107 @@ export function bootstrap( squash_merge_commit_title: z .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - ), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsStartForAuthenticatedUserBodySchema = z.object({ - lock_repositories: z.coerce.boolean().optional(), - exclude_metadata: z.coerce.boolean().optional(), - exclude_git_data: z.coerce.boolean().optional(), - exclude_attachments: z.coerce.boolean().optional(), - exclude_releases: z.coerce.boolean().optional(), - exclude_owner_projects: z.coerce.boolean().optional(), - org_metadata_only: z.coerce.boolean().optional(), - exclude: z.array(z.enum(["repositories"])).optional(), - repositories: z.array(z.coerce.string()), - }) - - router.post( - "migrationsStartForAuthenticatedUser", - "/user/migrations", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - migrationsStartForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.migrationsStartForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }), - ], - ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - ) - .optional(), - }), + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + ), ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + )(status, body) + ctx.status = status + return next() + } + ) + + const migrationsStartForAuthenticatedUserBodySchema = z.object({ + lock_repositories: z.coerce.boolean().optional(), + exclude_metadata: z.coerce.boolean().optional(), + exclude_git_data: z.coerce.boolean().optional(), + exclude_attachments: z.coerce.boolean().optional(), + exclude_releases: z.coerce.boolean().optional(), + exclude_owner_projects: z.coerce.boolean().optional(), + org_metadata_only: z.coerce.boolean().optional(), + exclude: z.array(z.enum(["repositories"])).optional(), + repositories: z.array(z.coerce.string()), + }) + + router.post( + "migrationsStartForAuthenticatedUser", + "/user/migrations", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + migrationsStartForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.migrationsStartForAuthenticatedUser(input, ctx) + + ctx.body = responseValidationFactory( + [ + ["201", s_migration], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -114007,379 +67475,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }), - ], + ["200", s_migration], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -114415,24 +67515,8 @@ export function bootstrap( [ ["302", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -114468,33 +67552,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -114531,33 +67591,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -114763,15 +67799,7 @@ export function bootstrap( }) ), ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) @@ -114823,24 +67851,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -115130,221 +68142,10 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_package]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -115384,33 +68185,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -115460,33 +68237,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -115577,33 +68330,9 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -115645,44 +68374,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }), - ], - ], + [["200", s_package_version]], undefined )(status, body) ctx.status = status @@ -115725,33 +68417,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -115797,33 +68465,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -115855,77 +68499,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }), - ], + ["201", s_project], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z.array(z.coerce.string()).optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error_simple], ], undefined )(status, body) @@ -115972,33 +68550,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -116342,47 +68896,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -116439,368 +68955,13 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - ], + ["201", s_repository], ["304", z.void()], - [ - "400", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - detail: z.coerce.string().optional(), - status: z.coerce.number().optional(), - scimType: z.coerce.string().optional(), - schemas: z.array(z.coerce.string()).optional(), - }), - ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["400", s_scim_error], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -117064,33 +69225,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -117126,33 +69263,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], ], undefined )(status, body) @@ -117188,33 +69301,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], ], undefined )(status, body) @@ -117261,33 +69350,9 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -117322,66 +69387,12 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "201", - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["201", s_ssh_signing_key], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -117415,43 +69426,11 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }), - ], + ["200", s_ssh_signing_key], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -117487,33 +69466,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -117858,24 +69813,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -117912,33 +69851,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -117972,33 +69887,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -118032,33 +69923,9 @@ export function bootstrap( [ ["204", z.void()], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -118261,24 +70128,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -118424,24 +70275,8 @@ export function bootstrap( ), ], ["304", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -118517,125 +70352,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.union([ - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - private_gists: z.coerce.number(), - total_private_repos: z.coerce.number(), - owned_private_repos: z.coerce.number(), - disk_usage: z.coerce.number(), - collaborators: z.coerce.number(), - two_factor_authentication: z.coerce.boolean(), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - business_plus: z.coerce.boolean().optional(), - ldap_dn: z.coerce.string().optional(), - }), - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }), - ]), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["200", z.union([s_private_user, s_public_user])], + ["404", s_basic_error], ], undefined )(status, body) @@ -121307,29 +73025,7 @@ export function bootstrap( }) ), ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -121450,49 +73146,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - contexts: z.array( - z.object({ - message: z.coerce.string(), - octicon: z.coerce.string(), - }) - ), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["200", s_hovercard], + ["404", s_basic_error], + ["422", s_validation_error], ], undefined )(status, body) @@ -121524,103 +73180,7 @@ export function bootstrap( ) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z.enum(["read", "write"]).optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }), - ], - ], + [["200", s_installation]], undefined )(status, body) ctx.status = status @@ -121969,24 +73529,8 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined )(status, body) @@ -122026,221 +73570,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ], - ], - undefined - )(status, body) + ctx.body = responseValidationFactory([["200", s_package]], undefined)( + status, + body + ) ctx.status = status return next() } @@ -122278,33 +73611,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -122352,33 +73661,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -122460,33 +73745,9 @@ export function bootstrap( }) ), ], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -122526,44 +73787,7 @@ export function bootstrap( await implementation.packagesGetPackageVersionForUser(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }), - ], - ], + [["200", s_package_version]], undefined )(status, body) ctx.status = status @@ -122604,33 +73828,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -122672,33 +73872,9 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "401", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], ], undefined )(status, body) @@ -122780,29 +73956,7 @@ export function bootstrap( }) ), ], - [ - "422", - z.object({ - message: z.coerce.string(), - documentation_url: z.coerce.string(), - errors: z - .array( - z.object({ - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - message: z.coerce.string().optional(), - code: z.coerce.string(), - index: z.coerce.number().optional(), - value: z.union([ - z.coerce.string(), - z.coerce.number(), - z.array(z.coerce.string()), - ]), - }) - ) - .optional(), - }), - ], + ["422", s_validation_error], ], undefined )(status, body) @@ -124627,33 +75781,7 @@ export function bootstrap( await implementation.billingGetGithubActionsBillingUser(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_minutes_used: z.coerce.number(), - total_paid_minutes_used: z.coerce.number(), - included_minutes: z.coerce.number(), - minutes_used_breakdown: z.object({ - UBUNTU: z.coerce.number().optional(), - MACOS: z.coerce.number().optional(), - WINDOWS: z.coerce.number().optional(), - ubuntu_4_core: z.coerce.number().optional(), - ubuntu_8_core: z.coerce.number().optional(), - ubuntu_16_core: z.coerce.number().optional(), - ubuntu_32_core: z.coerce.number().optional(), - ubuntu_64_core: z.coerce.number().optional(), - windows_4_core: z.coerce.number().optional(), - windows_8_core: z.coerce.number().optional(), - windows_16_core: z.coerce.number().optional(), - windows_32_core: z.coerce.number().optional(), - windows_64_core: z.coerce.number().optional(), - macos_12_core: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }), - }), - ], - ], + [["200", s_actions_billing_usage]], undefined )(status, body) ctx.status = status @@ -124682,16 +75810,7 @@ export function bootstrap( await implementation.billingGetGithubPackagesBillingUser(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_gigabytes_bandwidth_used: z.coerce.number(), - total_paid_gigabytes_bandwidth_used: z.coerce.number(), - included_gigabytes_bandwidth: z.coerce.number(), - }), - ], - ], + [["200", s_packages_billing_usage]], undefined )(status, body) ctx.status = status @@ -124720,16 +75839,7 @@ export function bootstrap( await implementation.billingGetSharedStorageBillingUser(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - days_left_in_billing_cycle: z.coerce.number(), - estimated_paid_storage_for_month: z.coerce.number(), - estimated_storage_for_month: z.coerce.number(), - }), - ], - ], + [["200", s_combined_billing_usage]], undefined )(status, body) ctx.status = status @@ -125042,15 +76152,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["200", z.array(z.coerce.string())], - [ - "404", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - url: z.coerce.string().optional(), - status: z.coerce.string().optional(), - }), - ], + ["404", s_basic_error], ], undefined )(status, body) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/schemas.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/schemas.ts new file mode 100644 index 000000000..767cd392c --- /dev/null +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/schemas.ts @@ -0,0 +1,15376 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint:disable */ + +import { z } from "zod" + +export const s_actions_billing_usage = z.object({ + total_minutes_used: z.coerce.number(), + total_paid_minutes_used: z.coerce.number(), + included_minutes: z.coerce.number(), + minutes_used_breakdown: z.object({ + UBUNTU: z.coerce.number().optional(), + MACOS: z.coerce.number().optional(), + WINDOWS: z.coerce.number().optional(), + ubuntu_4_core: z.coerce.number().optional(), + ubuntu_8_core: z.coerce.number().optional(), + ubuntu_16_core: z.coerce.number().optional(), + ubuntu_32_core: z.coerce.number().optional(), + ubuntu_64_core: z.coerce.number().optional(), + windows_4_core: z.coerce.number().optional(), + windows_8_core: z.coerce.number().optional(), + windows_16_core: z.coerce.number().optional(), + windows_32_core: z.coerce.number().optional(), + windows_64_core: z.coerce.number().optional(), + macos_12_core: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }), +}) + +export const s_actions_cache_list = z.object({ + total_count: z.coerce.number(), + actions_caches: z.array( + z.object({ + id: z.coerce.number().optional(), + ref: z.coerce.string().optional(), + key: z.coerce.string().optional(), + version: z.coerce.string().optional(), + last_accessed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + size_in_bytes: z.coerce.number().optional(), + }) + ), +}) + +export const s_actions_cache_usage_by_repository = z.object({ + full_name: z.coerce.string(), + active_caches_size_in_bytes: z.coerce.number(), + active_caches_count: z.coerce.number(), +}) + +export const s_actions_cache_usage_org_enterprise = z.object({ + total_active_caches_count: z.coerce.number(), + total_active_caches_size_in_bytes: z.coerce.number(), +}) + +export const s_actions_get_default_workflow_permissions = z.object({ + default_workflow_permissions: z.enum(["read", "write"]), + can_approve_pull_request_reviews: z.coerce.boolean(), +}) + +export const s_actions_organization_permissions = z.object({ + enabled_repositories: z.enum(["all", "none", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), + selected_actions_url: z.coerce.string().optional(), +}) + +export const s_actions_public_key = z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), +}) + +export const s_actions_repository_permissions = z.object({ + enabled: z.coerce.boolean(), + allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), + selected_actions_url: z.coerce.string().optional(), +}) + +export const s_actions_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_actions_set_default_workflow_permissions = z.object({ + default_workflow_permissions: z.enum(["read", "write"]).optional(), + can_approve_pull_request_reviews: z.coerce.boolean().optional(), +}) + +export const s_actions_variable = z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_actions_workflow_access_to_repository = z.object({ + access_level: z.enum(["none", "user", "organization", "enterprise"]), +}) + +export const s_api_overview = z.object({ + verifiable_password_authentication: z.coerce.boolean(), + ssh_key_fingerprints: z + .object({ + SHA256_RSA: z.coerce.string().optional(), + SHA256_DSA: z.coerce.string().optional(), + SHA256_ECDSA: z.coerce.string().optional(), + SHA256_ED25519: z.coerce.string().optional(), + }) + .optional(), + ssh_keys: z.array(z.coerce.string()).optional(), + hooks: z.array(z.coerce.string()).optional(), + web: z.array(z.coerce.string()).optional(), + api: z.array(z.coerce.string()).optional(), + git: z.array(z.coerce.string()).optional(), + packages: z.array(z.coerce.string()).optional(), + pages: z.array(z.coerce.string()).optional(), + importer: z.array(z.coerce.string()).optional(), + actions: z.array(z.coerce.string()).optional(), + dependabot: z.array(z.coerce.string()).optional(), +}) + +export const s_artifact = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), +}) + +export const s_authentication_token = z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({}).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + repository_selection: z.enum(["all", "selected"]).optional(), +}) + +export const s_authorization = z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + scopes: z.array(z.coerce.string()), + token: z.coerce.string(), + token_last_eight: z.coerce.string(), + hashed_token: z.coerce.string(), + app: z.object({ + client_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + note: z.coerce.string(), + note_url: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + fingerprint: z.coerce.string(), + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + installation: z + .object({ + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z.enum(["read", "write"]).optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z.enum(["read", "write", "admin"]).optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z.enum(["read", "write"]).optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z.enum(["read", "write", "admin"]).optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z.enum(["read", "write"]).optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + repository_selection: z.enum(["all", "selected"]), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + repositories_url: z.coerce.string(), + account: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + .optional(), + expires_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_autolink = z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), +}) + +export const s_base_gist = z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), +}) + +export const s_basic_error = z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + url: z.coerce.string().optional(), + status: z.coerce.string().optional(), +}) + +export const s_blob = z.object({ + content: z.coerce.string(), + encoding: z.coerce.string(), + url: z.coerce.string(), + sha: z.coerce.string(), + size: z.coerce.number(), + node_id: z.coerce.string(), + highlighted_content: z.coerce.string().optional(), +}) + +export const s_branch_protection = z.object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ context: z.coerce.string(), app_id: z.coerce.number() }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z.object({ enabled: z.coerce.boolean().optional() }).optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), +}) + +export const s_branch_restriction_policy = z.object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), +}) + +export const s_branch_with_protection = z.object({ + name: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + _links: z.object({ html: z.coerce.string(), self: z.coerce.string() }), + protected: z.coerce.boolean(), + protection: z.object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z + .object({ + url: z.coerce.string().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ context: z.coerce.string(), app_id: z.coerce.number() }) + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), + protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + }), + protection_url: z.coerce.string(), + pattern: z.coerce.string().optional(), + required_approving_review_count: z.coerce.number().optional(), +}) + +export const s_check_run = z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), +}) + +export const s_check_suite = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ name: z.coerce.string(), email: z.coerce.string() }), + committer: z.object({ name: z.coerce.string(), email: z.coerce.string() }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), +}) + +export const s_check_suite_preference = z.object({ + preferences: z.object({ + auto_trigger_checks: z + .array( + z.object({ app_id: z.coerce.number(), setting: z.coerce.boolean() }) + ) + .optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), +}) + +export const s_clone_traffic = z.object({ + count: z.coerce.number(), + uniques: z.coerce.number(), + clones: z.array( + z.object({ + timestamp: z.coerce.string().datetime({ offset: true }), + uniques: z.coerce.number(), + count: z.coerce.number(), + }) + ), +}) + +export const s_code_of_conduct = z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), +}) + +export const s_code_scanning_alert = z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z.enum(["none", "note", "warning", "error"]).optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z.enum(["open", "closed", "dismissed", "fixed"]).optional(), + commit_sha: z.coerce.string().optional(), + message: z.object({ text: z.coerce.string().optional() }).optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), +}) + +export const s_code_scanning_analysis_deletion = z.object({ + next_analysis_url: z.coerce.string(), + confirm_delete_url: z.coerce.string(), +}) + +export const s_code_scanning_codeql_database = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + language: z.coerce.string(), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), +}) + +export const s_code_scanning_sarifs_receipt = z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), +}) + +export const s_code_scanning_sarifs_status = z.object({ + processing_status: z.enum(["pending", "complete", "failed"]).optional(), + analyses_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), +}) + +export const s_codeowners_errors = z.object({ + errors: z.array( + z.object({ + line: z.coerce.number(), + column: z.coerce.number(), + source: z.coerce.string().optional(), + kind: z.coerce.string(), + suggestion: z.coerce.string().optional(), + message: z.coerce.string(), + path: z.coerce.string(), + }) + ), +}) + +export const s_codespace = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum(["EastUs", "SouthEastAsia", "WestEurope", "WestUs2"]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z.array(z.coerce.string()).optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce.string().datetime({ offset: true }).optional(), + last_known_stop_notice: z.coerce.string().optional(), +}) + +export const s_codespace_export_details = z.object({ + state: z.coerce.string().optional(), + completed_at: z.coerce.string().datetime({ offset: true }).optional(), + branch: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + id: z.coerce.string().optional(), + export_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), +}) + +export const s_codespace_with_full_repository = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum(["EastUs", "SouthEastAsia", "WestEurope", "WestUs2"]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z.array(z.coerce.string()).optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce.string().datetime({ offset: true }).optional(), +}) + +export const s_codespaces_org_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), +}) + +export const s_codespaces_public_key = z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), + id: z.coerce.number().optional(), + url: z.coerce.string().optional(), + title: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), +}) + +export const s_codespaces_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), +}) + +export const s_codespaces_user_public_key = z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), +}) + +export const s_combined_billing_usage = z.object({ + days_left_in_billing_cycle: z.coerce.number(), + estimated_paid_storage_for_month: z.coerce.number(), + estimated_storage_for_month: z.coerce.number(), +}) + +export const s_combined_commit_status = z.object({ + state: z.coerce.string(), + statuses: z.array( + z.object({ + description: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + context: z.coerce.string(), + target_url: z.coerce.string(), + required: z.coerce.boolean().optional(), + avatar_url: z.coerce.string(), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + sha: z.coerce.string(), + total_count: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + commit_url: z.coerce.string(), + url: z.coerce.string(), +}) + +export const s_commit = z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), +}) + +export const s_commit_comment = z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), +}) + +export const s_commit_comparison = z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + permalink_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + base_commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + merge_base_commit: z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }), + status: z.enum(["diverged", "ahead", "behind", "identical"]), + ahead_by: z.coerce.number(), + behind_by: z.coerce.number(), + total_commits: z.coerce.number(), + commits: z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), +}) + +export const s_community_profile = z.object({ + health_percentage: z.coerce.number(), + description: z.coerce.string(), + documentation: z.coerce.string(), + files: z.object({ + code_of_conduct: z.object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }), + code_of_conduct_file: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + contributing: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + readme: z.object({ url: z.coerce.string(), html_url: z.coerce.string() }), + issue_template: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + pull_request_template: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + }), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + content_reports_enabled: z.coerce.boolean().optional(), +}) + +export const s_content_directory = z.array( + z.object({ + type: z.enum(["dir", "file", "submodule", "symlink"]), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string().optional(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + }) +) + +export const s_content_file = z.object({ + type: z.enum(["file"]), + encoding: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + target: z.coerce.string().optional(), + submodule_git_url: z.coerce.string().optional(), +}) + +export const s_content_submodule = z.object({ + type: z.enum(["submodule"]), + submodule_git_url: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), +}) + +export const s_content_symlink = z.object({ + type: z.enum(["symlink"]), + target: z.coerce.string(), + size: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + download_url: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), +}) + +export const s_dependabot_alert = z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ ecosystem: z.coerce.string(), name: z.coerce.string() }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ identifier: z.coerce.string() }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ cwe_id: z.coerce.string(), name: z.coerce.string() }) + ), + identifiers: z.array( + z.object({ type: z.enum(["CVE", "GHSA"]), value: z.coerce.string() }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ identifier: z.coerce.string() }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_dependabot_public_key = z.object({ + key_id: z.coerce.string(), + key: z.coerce.string(), +}) + +export const s_dependabot_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_dependency_graph_diff = z.array( + z.object({ + change_type: z.enum(["added", "removed"]), + manifest: z.coerce.string(), + ecosystem: z.coerce.string(), + name: z.coerce.string(), + version: z.coerce.string(), + package_url: z.coerce.string(), + license: z.coerce.string(), + source_repository_url: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + severity: z.coerce.string(), + advisory_ghsa_id: z.coerce.string(), + advisory_summary: z.coerce.string(), + advisory_url: z.coerce.string(), + }) + ), + scope: z.enum(["unknown", "runtime", "development"]), + }) +) + +export const s_deploy_key = z.object({ + id: z.coerce.number(), + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), +}) + +export const s_deployment = z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), +}) + +export const s_deployment_branch_policy = z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), +}) + +export const s_deployment_branch_policy_name_pattern = z.object({ + name: z.coerce.string(), +}) + +export const s_deployment_status = z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), +}) + +export const s_empty_object = z.object({}) + +export const s_enterprise_security_analysis_settings = z.object({ + advanced_security_enabled_for_new_repositories: z.coerce.boolean(), + secret_scanning_enabled_for_new_repositories: z.coerce.boolean(), + secret_scanning_push_protection_enabled_for_new_repositories: + z.coerce.boolean(), + secret_scanning_push_protection_custom_link: z.coerce.string().optional(), +}) + +export const s_environment = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), +}) + +export const s_feed = z.object({ + timeline_url: z.coerce.string(), + user_url: z.coerce.string(), + current_user_public_url: z.coerce.string().optional(), + current_user_url: z.coerce.string().optional(), + current_user_actor_url: z.coerce.string().optional(), + current_user_organization_url: z.coerce.string().optional(), + current_user_organization_urls: z.array(z.coerce.string()).optional(), + security_advisories_url: z.coerce.string().optional(), + repository_discussions_url: z.coerce.string().optional(), + repository_discussions_category_url: z.coerce.string().optional(), + _links: z.object({ + timeline: z.object({ href: z.coerce.string(), type: z.coerce.string() }), + user: z.object({ href: z.coerce.string(), type: z.coerce.string() }), + security_advisories: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_public: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_actor: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_organization: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + current_user_organizations: z + .array(z.object({ href: z.coerce.string(), type: z.coerce.string() })) + .optional(), + repository_discussions: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + repository_discussions_category: z + .object({ href: z.coerce.string(), type: z.coerce.string() }) + .optional(), + }), +}) + +export const s_file_commit = z.object({ + content: z.object({ + name: z.coerce.string().optional(), + path: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + download_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + _links: z + .object({ + self: z.coerce.string().optional(), + git: z.coerce.string().optional(), + html: z.coerce.string().optional(), + }) + .optional(), + }), + commit: z.object({ + sha: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + author: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + committer: z + .object({ + date: z.coerce.string().optional(), + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + tree: z + .object({ + url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + .optional(), + parents: z + .array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ) + .optional(), + verification: z + .object({ + verified: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + signature: z.coerce.string().optional(), + payload: z.coerce.string().optional(), + }) + .optional(), + }), +}) + +export const s_full_repository = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number(), + network_count: z.coerce.number(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + source: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + forks: z.coerce.number(), + master_branch: z.coerce.string().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + anonymous_access_enabled: z.coerce.boolean().optional(), + code_of_conduct: z + .object({ + url: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), + html_url: z.coerce.string(), + }) + .optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), +}) + +export const s_gist_comment = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), +}) + +export const s_gist_simple = z.object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce.string().datetime({ offset: true }).optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), + }) + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), +}) + +export const s_git_commit = z.object({ + sha: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + author: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + committer: z.object({ + date: z.coerce.string().datetime({ offset: true }), + email: z.coerce.string(), + name: z.coerce.string(), + }), + message: z.coerce.string(), + tree: z.object({ sha: z.coerce.string(), url: z.coerce.string() }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + }) + ), + verification: z.object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + signature: z.coerce.string(), + payload: z.coerce.string(), + }), + html_url: z.coerce.string(), +}) + +export const s_git_ref = z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), +}) + +export const s_git_tag = z.object({ + node_id: z.coerce.string(), + tag: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + message: z.coerce.string(), + tagger: z.object({ + date: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + }), + object: z.object({ + sha: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), +}) + +export const s_git_tree = z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + truncated: z.coerce.boolean(), + tree: z.array( + z.object({ + path: z.coerce.string().optional(), + mode: z.coerce.string().optional(), + type: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + size: z.coerce.number().optional(), + url: z.coerce.string().optional(), + }) + ), +}) + +export const s_gitignore_template = z.object({ + name: z.coerce.string(), + source: z.coerce.string(), +}) + +export const s_gpg_key = z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), +}) + +export const s_hook = z.object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), +}) + +export const s_hook_delivery = z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + url: z.coerce.string().optional(), + request: z.object({ headers: z.object({}), payload: z.object({}) }), + response: z.object({ headers: z.object({}), payload: z.coerce.string() }), +}) + +export const s_hovercard = z.object({ + contexts: z.array( + z.object({ message: z.coerce.string(), octicon: z.coerce.string() }) + ), +}) + +export const s_import = z.object({ + vcs: z.coerce.string(), + use_lfs: z.coerce.boolean().optional(), + vcs_url: z.coerce.string(), + svc_root: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + status: z.enum([ + "auth", + "error", + "none", + "detecting", + "choose", + "auth_failed", + "importing", + "mapping", + "waiting_to_push", + "pushing", + "complete", + "setup", + "unknown", + "detection_found_multiple", + "detection_found_nothing", + "detection_needs_auth", + ]), + status_text: z.coerce.string().optional(), + failed_step: z.coerce.string().optional(), + error_message: z.coerce.string().optional(), + import_percent: z.coerce.number().optional(), + commit_count: z.coerce.number().optional(), + push_percent: z.coerce.number().optional(), + has_large_files: z.coerce.boolean().optional(), + large_files_size: z.coerce.number().optional(), + large_files_count: z.coerce.number().optional(), + project_choices: z + .array( + z.object({ + vcs: z.coerce.string().optional(), + tfvc_project: z.coerce.string().optional(), + human_name: z.coerce.string().optional(), + }) + ) + .optional(), + message: z.coerce.string().optional(), + authors_count: z.coerce.number().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + authors_url: z.coerce.string(), + repository_url: z.coerce.string(), + svn_root: z.coerce.string().optional(), +}) + +export const s_installation = z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z.enum(["read", "write"]).optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z.enum(["read", "write", "admin"]).optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z.enum(["read", "write"]).optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z.enum(["read", "write", "admin"]).optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z.enum(["read", "write"]).optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), +}) + +export const s_installation_token = z.object({ + token: z.coerce.string(), + expires_at: z.coerce.string(), + permissions: z + .object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z.enum(["read", "write"]).optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z.enum(["read", "write", "admin"]).optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z.enum(["read", "write"]).optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z.enum(["read", "write", "admin"]).optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z.enum(["read", "write"]).optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }) + .optional(), + repository_selection: z.enum(["all", "selected"]).optional(), + repositories: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ) + .optional(), + single_file: z.coerce.string().optional(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), +}) + +export const s_integration = z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), +}) + +export const s_interaction_limit = z.object({ + limit: z.enum(["existing_users", "contributors_only", "collaborators_only"]), + expiry: z + .enum(["one_day", "three_days", "one_week", "one_month", "six_months"]) + .optional(), +}) + +export const s_interaction_limit_response = z.object({ + limit: z.enum(["existing_users", "contributors_only", "collaborators_only"]), + origin: z.coerce.string(), + expires_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_issue = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z.enum(["completed", "reopened", "not_planned"]).optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce.string().datetime({ offset: true }).optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), +}) + +export const s_issue_comment = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), +}) + +export const s_issue_event = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + actor: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + issue: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z.enum(["completed", "reopened", "not_planned"]).optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce.string().datetime({ offset: true }).optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), +}) + +export const s_job = z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce.string().datetime({ offset: true }).optional(), + completed_at: z.coerce.string().datetime({ offset: true }).optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), +}) + +export const s_key = z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), +}) + +export const s_label = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), +}) + +export const s_language = z.object({}) + +export const s_license = z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + spdx_id: z.coerce.string(), + url: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + description: z.coerce.string(), + implementation: z.coerce.string(), + permissions: z.array(z.coerce.string()), + conditions: z.array(z.coerce.string()), + limitations: z.array(z.coerce.string()), + body: z.coerce.string(), + featured: z.coerce.boolean(), +}) + +export const s_license_content = z.object({ + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + size: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + git_url: z.coerce.string(), + download_url: z.coerce.string(), + type: z.coerce.string(), + content: z.coerce.string(), + encoding: z.coerce.string(), + _links: z.object({ + git: z.coerce.string(), + html: z.coerce.string(), + self: z.coerce.string(), + }), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), +}) + +export const s_marketplace_purchase = z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), +}) + +export const s_merged_upstream = z.object({ + message: z.coerce.string().optional(), + merge_type: z.enum(["merge", "fast-forward", "none"]).optional(), + base_branch: z.coerce.string().optional(), +}) + +export const s_migration = z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), +}) + +export const s_milestone = z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), +}) + +export const s_minimal_repository = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), +}) + +export const s_oidc_custom_sub = z.object({ + include_claim_keys: z.array(z.coerce.string()), +}) + +export const s_oidc_custom_sub_repo = z.object({ + use_default: z.coerce.boolean(), + include_claim_keys: z.array(z.coerce.string()).optional(), +}) + +export const s_org_hook = z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), +}) + +export const s_org_membership = z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), +}) + +export const s_organization_actions_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), +}) + +export const s_organization_actions_variable = z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), +}) + +export const s_organization_dependabot_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), +}) + +export const s_organization_full = z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce.string().optional(), + members_can_create_public_repositories: z.coerce.boolean().optional(), + members_can_create_private_repositories: z.coerce.boolean().optional(), + members_can_create_internal_repositories: z.coerce.boolean().optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + advanced_security_enabled_for_new_repositories: z.coerce.boolean().optional(), + dependabot_alerts_enabled_for_new_repositories: z.coerce.boolean().optional(), + dependabot_security_updates_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + dependency_graph_enabled_for_new_repositories: z.coerce.boolean().optional(), + secret_scanning_enabled_for_new_repositories: z.coerce.boolean().optional(), + secret_scanning_push_protection_enabled_for_new_repositories: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link_enabled: z.coerce + .boolean() + .optional(), + secret_scanning_push_protection_custom_link: z.coerce.string().optional(), +}) + +export const s_organization_invitation = z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), +}) + +export const s_package = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_package_version = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce.string().datetime({ offset: true }).optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z.object({ tags: z.array(z.coerce.string()) }).optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), +}) + +export const s_packages_billing_usage = z.object({ + total_gigabytes_bandwidth_used: z.coerce.number(), + total_paid_gigabytes_bandwidth_used: z.coerce.number(), + included_gigabytes_bandwidth: z.coerce.number(), +}) + +export const s_page = z.object({ + url: z.coerce.string(), + status: z.enum(["built", "building", "errored"]), + cname: z.coerce.string(), + protected_domain_state: z + .enum(["pending", "verified", "unverified"]) + .optional(), + pending_domain_unverified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + custom_404: z.coerce.boolean(), + html_url: z.coerce.string().optional(), + build_type: z.enum(["legacy", "workflow"]).optional(), + source: z + .object({ branch: z.coerce.string(), path: z.coerce.string() }) + .optional(), + public: z.coerce.boolean(), + https_certificate: z + .object({ + state: z.enum([ + "new", + "authorization_created", + "authorization_pending", + "authorized", + "authorization_revoked", + "issued", + "uploaded", + "approved", + "errored", + "bad_authz", + "destroy_pending", + "dns_changed", + ]), + description: z.coerce.string(), + domains: z.array(z.coerce.string()), + expires_at: z.coerce.string().optional(), + }) + .optional(), + https_enforced: z.coerce.boolean().optional(), +}) + +export const s_page_build = z.object({ + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_page_build_status = z.object({ + url: z.coerce.string(), + status: z.coerce.string(), +}) + +export const s_page_deployment = z.object({ + status_url: z.coerce.string(), + page_url: z.coerce.string(), + preview_url: z.coerce.string().optional(), +}) + +export const s_pages_health_check = z.object({ + domain: z + .object({ + host: z.coerce.string().optional(), + uri: z.coerce.string().optional(), + nameservers: z.coerce.string().optional(), + dns_resolves: z.coerce.boolean().optional(), + is_proxied: z.coerce.boolean().optional(), + is_cloudflare_ip: z.coerce.boolean().optional(), + is_fastly_ip: z.coerce.boolean().optional(), + is_old_ip_address: z.coerce.boolean().optional(), + is_a_record: z.coerce.boolean().optional(), + has_cname_record: z.coerce.boolean().optional(), + has_mx_records_present: z.coerce.boolean().optional(), + is_valid_domain: z.coerce.boolean().optional(), + is_apex_domain: z.coerce.boolean().optional(), + should_be_a_record: z.coerce.boolean().optional(), + is_cname_to_github_user_domain: z.coerce.boolean().optional(), + is_cname_to_pages_dot_github_dot_com: z.coerce.boolean().optional(), + is_cname_to_fastly: z.coerce.boolean().optional(), + is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), + is_non_github_pages_ip_present: z.coerce.boolean().optional(), + is_pages_domain: z.coerce.boolean().optional(), + is_served_by_pages: z.coerce.boolean().optional(), + is_valid: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + responds_to_https: z.coerce.boolean().optional(), + enforces_https: z.coerce.boolean().optional(), + https_error: z.coerce.string().optional(), + is_https_eligible: z.coerce.boolean().optional(), + caa_error: z.coerce.string().optional(), + }) + .optional(), + alt_domain: z + .object({ + host: z.coerce.string().optional(), + uri: z.coerce.string().optional(), + nameservers: z.coerce.string().optional(), + dns_resolves: z.coerce.boolean().optional(), + is_proxied: z.coerce.boolean().optional(), + is_cloudflare_ip: z.coerce.boolean().optional(), + is_fastly_ip: z.coerce.boolean().optional(), + is_old_ip_address: z.coerce.boolean().optional(), + is_a_record: z.coerce.boolean().optional(), + has_cname_record: z.coerce.boolean().optional(), + has_mx_records_present: z.coerce.boolean().optional(), + is_valid_domain: z.coerce.boolean().optional(), + is_apex_domain: z.coerce.boolean().optional(), + should_be_a_record: z.coerce.boolean().optional(), + is_cname_to_github_user_domain: z.coerce.boolean().optional(), + is_cname_to_pages_dot_github_dot_com: z.coerce.boolean().optional(), + is_cname_to_fastly: z.coerce.boolean().optional(), + is_pointed_to_github_pages_ip: z.coerce.boolean().optional(), + is_non_github_pages_ip_present: z.coerce.boolean().optional(), + is_pages_domain: z.coerce.boolean().optional(), + is_served_by_pages: z.coerce.boolean().optional(), + is_valid: z.coerce.boolean().optional(), + reason: z.coerce.string().optional(), + responds_to_https: z.coerce.boolean().optional(), + enforces_https: z.coerce.boolean().optional(), + https_error: z.coerce.string().optional(), + is_https_eligible: z.coerce.boolean().optional(), + caa_error: z.coerce.string().optional(), + }) + .optional(), +}) + +export const s_participation_stats = z.object({ + all: z.array(z.coerce.number()), + owner: z.array(z.coerce.number()), +}) + +export const s_porter_author = z.object({ + id: z.coerce.number(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), +}) + +export const s_private_user = z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + private_gists: z.coerce.number(), + total_private_repos: z.coerce.number(), + owned_private_repos: z.coerce.number(), + disk_usage: z.coerce.number(), + collaborators: z.coerce.number(), + two_factor_authentication: z.coerce.boolean(), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce.string().datetime({ offset: true }).optional(), + business_plus: z.coerce.boolean().optional(), + ldap_dn: z.coerce.string().optional(), +}) + +export const s_project = z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), +}) + +export const s_project_card = z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), +}) + +export const s_project_collaborator_permission = z.object({ + permission: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), +}) + +export const s_project_column = z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_protected_branch = z.object({ + url: z.coerce.string(), + required_status_checks: z + .object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ context: z.coerce.string(), app_id: z.coerce.number() }) + ), + contexts_url: z.coerce.string(), + }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string(), + dismiss_stale_reviews: z.coerce.boolean().optional(), + require_code_owner_reviews: z.coerce.boolean().optional(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), + dismissal_restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + }) + .optional(), + required_signatures: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + enforce_admins: z + .object({ url: z.coerce.string(), enabled: z.coerce.boolean() }) + .optional(), + required_linear_history: z.object({ enabled: z.coerce.boolean() }).optional(), + allow_force_pushes: z.object({ enabled: z.coerce.boolean() }).optional(), + allow_deletions: z.object({ enabled: z.coerce.boolean() }).optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), + }) + ), + }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z.object({ enabled: z.coerce.boolean() }).optional(), + lock_branch: z.object({ enabled: z.coerce.boolean().optional() }).optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), +}) + +export const s_protected_branch_admin_enforced = z.object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), +}) + +export const s_protected_branch_pull_request_review = z.object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + }) + .optional(), + bypass_pull_request_allowances: z + .object({ + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + }) + .optional(), + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce.number().optional(), + require_last_push_approval: z.coerce.boolean().optional(), +}) + +export const s_public_user = z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce.string().datetime({ offset: true }).optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), +}) + +export const s_pull_request = z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + description: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + fork: z.coerce.boolean(), + forks_url: z.coerce.string(), + full_name: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + hooks_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + node_id: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + name: z.coerce.string(), + notifications_url: z.coerce.string(), + owner: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + private: z.coerce.boolean(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + url: z.coerce.string(), + clone_url: z.coerce.string(), + default_branch: z.coerce.string(), + forks: z.coerce.number(), + forks_count: z.coerce.number(), + git_url: z.coerce.string(), + has_downloads: z.coerce.boolean(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_discussions: z.coerce.boolean(), + homepage: z.coerce.string(), + language: z.coerce.string(), + master_branch: z.coerce.string().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + mirror_url: z.coerce.string(), + open_issues: z.coerce.number(), + open_issues_count: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + pushed_at: z.coerce.string().datetime({ offset: true }), + size: z.coerce.number(), + ssh_url: z.coerce.string(), + stargazers_count: z.coerce.number(), + svn_url: z.coerce.string(), + topics: z.array(z.coerce.string()).optional(), + watchers: z.coerce.number(), + watchers_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + avatar_url: z.coerce.string(), + events_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + login: z.coerce.string(), + organizations_url: z.coerce.string(), + received_events_url: z.coerce.string(), + repos_url: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + type: z.coerce.string(), + url: z.coerce.string(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + merged: z.coerce.boolean(), + mergeable: z.coerce.boolean(), + rebaseable: z.coerce.boolean().optional(), + mergeable_state: z.coerce.string(), + merged_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments: z.coerce.number(), + review_comments: z.coerce.number(), + maintainer_can_modify: z.coerce.boolean(), + commits: z.coerce.number(), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changed_files: z.coerce.number(), +}) + +export const s_pull_request_merge_result = z.object({ + sha: z.coerce.string(), + merged: z.coerce.boolean(), + message: z.coerce.string(), +}) + +export const s_pull_request_review = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce.string().datetime({ offset: true }).optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), +}) + +export const s_pull_request_review_comment = z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), +}) + +export const s_pull_request_review_request = z.object({ + users: z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), +}) + +export const s_pull_request_simple = z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), +}) + +export const s_rate_limit_overview = z.object({ + resources: z.object({ + core: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), + graphql: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + search: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), + source_import: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + integration_manifest: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + code_scanning_upload: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + actions_runner_registration: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + scim: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + dependency_snapshots: z + .object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }) + .optional(), + }), + rate: z.object({ + limit: z.coerce.number(), + remaining: z.coerce.number(), + reset: z.coerce.number(), + used: z.coerce.number(), + }), +}) + +export const s_reaction = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_release = z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), +}) + +export const s_release_asset = z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), +}) + +export const s_release_notes_content = z.object({ + name: z.coerce.string(), + body: z.coerce.string(), +}) + +export const s_repo_codespaces_secret = z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_repo_required_workflow = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum(["active", "deleted"]), + source_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), +}) + +export const s_repository = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), +}) + +export const s_repository_collaborator_permission = z.object({ + permission: z.coerce.string(), + role_name: z.coerce.string(), + user: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + }) + .optional(), + role_name: z.coerce.string(), + }), +}) + +export const s_repository_invitation = z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum(["read", "write", "admin", "triage", "maintain"]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), +}) + +export const s_repository_subscription = z.object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + repository_url: z.coerce.string(), +}) + +export const s_required_workflow = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), +}) + +export const s_root = z.object({ + current_user_url: z.coerce.string(), + current_user_authorizations_html_url: z.coerce.string(), + authorizations_url: z.coerce.string(), + code_search_url: z.coerce.string(), + commit_search_url: z.coerce.string(), + emails_url: z.coerce.string(), + emojis_url: z.coerce.string(), + events_url: z.coerce.string(), + feeds_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + hub_url: z.coerce.string(), + issue_search_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + label_search_url: z.coerce.string(), + notifications_url: z.coerce.string(), + organization_url: z.coerce.string(), + organization_repositories_url: z.coerce.string(), + organization_teams_url: z.coerce.string(), + public_gists_url: z.coerce.string(), + rate_limit_url: z.coerce.string(), + repository_url: z.coerce.string(), + repository_search_url: z.coerce.string(), + current_user_repositories_url: z.coerce.string(), + starred_url: z.coerce.string(), + starred_gists_url: z.coerce.string(), + topic_search_url: z.coerce.string().optional(), + user_url: z.coerce.string(), + user_organizations_url: z.coerce.string(), + user_repositories_url: z.coerce.string(), + user_search_url: z.coerce.string(), +}) + +export const s_runner = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), +}) + +export const s_runner_groups_enterprise = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), +}) + +export const s_runner_groups_org = z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce.boolean().optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), +}) + +export const s_scim_error = z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + detail: z.coerce.string().optional(), + status: z.coerce.number().optional(), + scimType: z.coerce.string().optional(), + schemas: z.array(z.coerce.string()).optional(), +}) + +export const s_secret_scanning_alert = z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum(["null", "false_positive", "wont_fix", "revoked", "used_in_tests"]) + .optional(), + resolved_at: z.coerce.string().datetime({ offset: true }).optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), +}) + +export const s_secret_scanning_location_commit = z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + blob_sha: z.coerce.string(), + blob_url: z.coerce.string(), + commit_sha: z.coerce.string(), + commit_url: z.coerce.string(), +}) + +export const s_secret_scanning_location_issue_body = z.object({ + issue_body_url: z.coerce.string(), +}) + +export const s_secret_scanning_location_issue_comment = z.object({ + issue_comment_url: z.coerce.string(), +}) + +export const s_secret_scanning_location_issue_title = z.object({ + issue_title_url: z.coerce.string(), +}) + +export const s_selected_actions = z.object({ + github_owned_allowed: z.coerce.boolean().optional(), + verified_allowed: z.coerce.boolean().optional(), + patterns_allowed: z.array(z.coerce.string()).optional(), +}) + +export const s_short_blob = z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), +}) + +export const s_snapshot = z.object({ + version: z.coerce.number(), + job: z.object({ + id: z.coerce.string(), + correlator: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + sha: z.coerce.string(), + ref: z.coerce.string(), + detector: z.object({ + name: z.coerce.string(), + version: z.coerce.string(), + url: z.coerce.string(), + }), + metadata: z.object({}).optional(), + manifests: z.object({}).optional(), + scanned: z.coerce.string().datetime({ offset: true }), +}) + +export const s_ssh_signing_key = z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), +}) + +export const s_status = z.object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), +}) + +export const s_status_check_policy = z.object({ + url: z.coerce.string(), + strict: z.coerce.boolean(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ context: z.coerce.string(), app_id: z.coerce.number() }) + ), + contexts_url: z.coerce.string(), +}) + +export const s_tag_protection = z.object({ + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), +}) + +export const s_team_discussion = z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), +}) + +export const s_team_discussion_comment = z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), +}) + +export const s_team_full = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) + .optional(), + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce.string().optional(), + members_can_create_public_repositories: z.coerce.boolean().optional(), + members_can_create_private_repositories: z.coerce.boolean().optional(), + members_can_create_internal_repositories: z.coerce.boolean().optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), +}) + +export const s_team_membership = z.object({ + url: z.coerce.string(), + role: z.enum(["member", "maintainer"]), + state: z.enum(["active", "pending"]), +}) + +export const s_team_project = z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), +}) + +export const s_team_repository = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), +}) + +export const s_thread = z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), +}) + +export const s_thread_subscription = z.object({ + subscribed: z.coerce.boolean(), + ignored: z.coerce.boolean(), + reason: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + thread_url: z.coerce.string().optional(), + repository_url: z.coerce.string().optional(), +}) + +export const s_topic = z.object({ names: z.array(z.coerce.string()) }) + +export const s_validation_error = z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z + .array( + z.object({ + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + message: z.coerce.string().optional(), + code: z.coerce.string(), + index: z.coerce.number().optional(), + value: z.union([ + z.coerce.string(), + z.coerce.number(), + z.array(z.coerce.string()), + ]), + }) + ) + .optional(), +}) + +export const s_validation_error_simple = z.object({ + message: z.coerce.string(), + documentation_url: z.coerce.string(), + errors: z.array(z.coerce.string()).optional(), +}) + +export const s_view_traffic = z.object({ + count: z.coerce.number(), + uniques: z.coerce.number(), + views: z.array( + z.object({ + timestamp: z.coerce.string().datetime({ offset: true }), + uniques: z.coerce.number(), + count: z.coerce.number(), + }) + ), +}) + +export const s_webhook_config = z.object({ + url: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), +}) + +export const s_workflow = z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + deleted_at: z.coerce.string().datetime({ offset: true }).optional(), +}) + +export const s_workflow_run = z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce.string().datetime({ offset: true }).optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ name: z.coerce.string(), email: z.coerce.string() }), + committer: z.object({ name: z.coerce.string(), email: z.coerce.string() }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + secret_scanning_push_protection: z + .object({ status: z.enum(["enabled", "disabled"]).optional() }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), +}) + +export const s_workflow_run_usage = z.object({ + billable: z.object({ + UBUNTU: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + MACOS: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + WINDOWS: z + .object({ + total_ms: z.coerce.number(), + jobs: z.coerce.number(), + job_runs: z + .array( + z.object({ + job_id: z.coerce.number(), + duration_ms: z.coerce.number(), + }) + ) + .optional(), + }) + .optional(), + }), + run_duration_ms: z.coerce.number().optional(), +}) + +export const s_workflow_usage = z.object({ + billable: z.object({ + UBUNTU: z.object({ total_ms: z.coerce.number().optional() }).optional(), + MACOS: z.object({ total_ms: z.coerce.number().optional() }).optional(), + WINDOWS: z.object({ total_ms: z.coerce.number().optional() }).optional(), + }), +}) diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts index 8dd8aec9a..21dfdfe3b 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts @@ -8,8 +8,10 @@ import { t_Error, t_FindPetByIdParamSchema, t_FindPetsQuerySchema, + t_NewPet, t_Pet, } from "./models" +import { s_Error, s_NewPet, s_Pet } from "./schemas" import KoaRouter from "@koa/router" import { Response, @@ -81,29 +83,14 @@ export function bootstrap( const { status, body } = await implementation.findPets(input, ctx) ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z - .object({ - name: z.coerce.string(), - tag: z.coerce.string().optional(), - }) - .merge(z.object({ id: z.coerce.number() })) - ), - ], - ], - z.object({ code: z.coerce.number(), message: z.coerce.string() }) + [["200", z.array(s_NewPet.merge(z.object({ id: z.coerce.number() })))]], + s_Error )(status, body) ctx.status = status return next() }) - const addPetBodySchema = z.object({ - name: z.coerce.string(), - tag: z.coerce.string().optional(), - }) + const addPetBodySchema = s_NewPet router.post("addPet", "/pets", async (ctx, next) => { const input = { @@ -114,20 +101,10 @@ export function bootstrap( const { status, body } = await implementation.addPet(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z - .object({ - name: z.coerce.string(), - tag: z.coerce.string().optional(), - }) - .merge(z.object({ id: z.coerce.number() })), - ], - ], - z.object({ code: z.coerce.number(), message: z.coerce.string() }) - )(status, body) + ctx.body = responseValidationFactory([["200", s_Pet]], s_Error)( + status, + body + ) ctx.status = status return next() }) @@ -143,20 +120,10 @@ export function bootstrap( const { status, body } = await implementation.findPetById(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z - .object({ - name: z.coerce.string(), - tag: z.coerce.string().optional(), - }) - .merge(z.object({ id: z.coerce.number() })), - ], - ], - z.object({ code: z.coerce.number(), message: z.coerce.string() }) - )(status, body) + ctx.body = responseValidationFactory([["200", s_Pet]], s_Error)( + status, + body + ) ctx.status = status return next() }) @@ -172,10 +139,10 @@ export function bootstrap( const { status, body } = await implementation.deletePet(input, ctx) - ctx.body = responseValidationFactory( - [["204", z.void()]], - z.object({ code: z.coerce.number(), message: z.coerce.string() }) - )(status, body) + ctx.body = responseValidationFactory([["204", z.void()]], s_Error)( + status, + body + ) ctx.status = status return next() }) diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/schemas.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/schemas.ts new file mode 100644 index 000000000..1e712bd9f --- /dev/null +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/schemas.ts @@ -0,0 +1,17 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint:disable */ + +import { z } from "zod" + +export const s_Error = z.object({ + code: z.coerce.number(), + message: z.coerce.string(), +}) + +export const s_NewPet = z.object({ + name: z.coerce.string(), + tag: z.coerce.string().optional(), +}) + +export const s_Pet = s_NewPet.merge(z.object({ id: z.coerce.number() })) diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts index 27ef66942..e68fe4bff 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts @@ -11,6 +11,7 @@ import { t_UpdateTodoListByIdBodySchema, t_UpdateTodoListByIdParamSchema, } from "./models" +import { s_CreateUpdateTodoList, s_Error, s_TodoList } from "./schemas" import KoaRouter from "@koa/router" import { Response, @@ -132,24 +133,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.string(), - name: z.coerce.string(), - totalItemCount: z.coerce.number(), - incompleteItemCount: z.coerce.number(), - created: z.coerce.string().datetime({ offset: true }), - updated: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "4XX", - z.object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }), - ], + ["200", s_TodoList], + ["4XX", s_Error], ], z.void() )(status, body) @@ -159,7 +144,7 @@ export function bootstrap( const updateTodoListByIdParamSchema = z.object({ listId: z.coerce.string() }) - const updateTodoListByIdBodySchema = z.object({ name: z.coerce.string() }) + const updateTodoListByIdBodySchema = s_CreateUpdateTodoList router.put("updateTodoListById", "/list/:listId", async (ctx, next) => { const input = { @@ -172,24 +157,8 @@ export function bootstrap( ctx.body = responseValidationFactory( [ - [ - "200", - z.object({ - id: z.coerce.string(), - name: z.coerce.string(), - totalItemCount: z.coerce.number(), - incompleteItemCount: z.coerce.number(), - created: z.coerce.string().datetime({ offset: true }), - updated: z.coerce.string().datetime({ offset: true }), - }), - ], - [ - "4XX", - z.object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }), - ], + ["200", s_TodoList], + ["4XX", s_Error], ], z.void() )(status, body) @@ -211,13 +180,7 @@ export function bootstrap( ctx.body = responseValidationFactory( [ ["204", z.void()], - [ - "4XX", - z.object({ - message: z.coerce.string().optional(), - code: z.coerce.number().optional(), - }), - ], + ["4XX", s_Error], ], z.void() )(status, body) diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/schemas.ts b/integration-tests/typescript-koa/src/todo-lists.yml/schemas.ts new file mode 100644 index 000000000..a026fe776 --- /dev/null +++ b/integration-tests/typescript-koa/src/todo-lists.yml/schemas.ts @@ -0,0 +1,21 @@ +/** AUTOGENERATED - DO NOT EDIT **/ +/* tslint:disable */ +/* eslint:disable */ + +import { z } from "zod" + +export const s_Error = z.object({ + message: z.coerce.string().optional(), + code: z.coerce.number().optional(), +}) + +export const s_CreateUpdateTodoList = z.object({ name: z.coerce.string() }) + +export const s_TodoList = z.object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), +}) diff --git a/packages/openapi-code-generator/src/core/openapi-utils.ts b/packages/openapi-code-generator/src/core/openapi-utils.ts index 6024c09a4..469793327 100644 --- a/packages/openapi-code-generator/src/core/openapi-utils.ts +++ b/packages/openapi-code-generator/src/core/openapi-utils.ts @@ -7,7 +7,7 @@ export function isRef(it: any | Reference): it is Reference { return Reflect.has(it, "$ref") } -export function getNameFromRef({ $ref }: Reference): string { +export function getNameFromRef({ $ref }: Reference, prefix: string): string { const name = $ref.split("/").pop() if (!name) { @@ -16,5 +16,5 @@ export function getNameFromRef({ $ref }: Reference): string { // TODO: this is a hack to workaround reserved words being used as names // can likely improve to selectively apply when a reserved word is used. - return "t_" + name.replace(/-/g, "_") + return prefix + name.replace(/-/g, "_") } diff --git a/packages/openapi-code-generator/src/typescript/common/model-builder.ts b/packages/openapi-code-generator/src/typescript/common/model-builder.ts index abf366b00..08d9e45dd 100644 --- a/packages/openapi-code-generator/src/typescript/common/model-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/model-builder.ts @@ -25,7 +25,7 @@ export class ModelBuilder { private add({ $ref }: Reference): string { this.referenced.add($ref) - const name = getNameFromRef({ $ref }) + const name = getNameFromRef({ $ref }, "t_") if (this.imports) { this.imports.addSingle(name, this.filename) @@ -54,7 +54,7 @@ export class ModelBuilder { } private generateModelFromRef($ref: string): string { - const name = getNameFromRef({ $ref }) + const name = getNameFromRef({ $ref }, "t_") const schemaObject = this.input.schema({ $ref }) // Arrays @@ -145,7 +145,7 @@ export class ModelBuilder { `"${name}"`, isRequired ? "" : "?", ":", - getNameFromRef(definition), + getNameFromRef(definition, "t_"), ";", ].filter(Boolean).join(" ") } diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts index 52bdb2068..a37a8460e 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts @@ -1,14 +1,67 @@ import {IRModelObject, IRModelString, IRParameter, MaybeIRModel} from "../../../core/openapi-types-normalized" import {ImportBuilder} from "../../common/import-builder" import {Input} from "../../../core/input" +import {getNameFromRef, isRef} from "../../../core/openapi-utils" +import {Reference} from "../../../core/openapi-types" export abstract class AbstractSchemaBuilder { - protected constructor(private readonly input: Input) { + protected constructor( + public readonly filename: string, + private readonly input: Input, + private readonly imports: ImportBuilder, + private readonly referenced = new Set(), + ) { } + private add({$ref}: Reference): string { + this.referenced.add($ref) - abstract importHelpers(importBuilder: ImportBuilder): void + const name = getNameFromRef({$ref}, "s_") + + if (this.imports) { + this.imports.addSingle(name, this.filename) + } + + return name + } + + toString(): string { + const generate = () => Array.from(this.referenced.values()) + .sort() + .map(($ref) => this.generateSchemaFromRef($ref)) + + // Super lazy way of discovering sub-references for generation easily... + // could obviously be optimized but in most cases is plenty fast enough. + let previous = generate() + let next = generate() + + while (previous.length != next.length) { + previous = next + next = generate() + } + + const imports = new ImportBuilder() + this.importHelpers(imports) + + return ` + + ${imports.toString()} + + ${next.join("\n\n")} + ` + } + + private generateSchemaFromRef($ref: string): string { + const name = getNameFromRef({ $ref }, "s_") + const schemaObject = this.input.schema({ $ref }) + + return ` + export const ${ name } = ${ this.fromModel(schemaObject, true) } + ` + } + + protected abstract importHelpers(importBuilder: ImportBuilder): void fromParameters(parameters: IRParameter[]): string { const model: IRModelObject = { @@ -33,6 +86,11 @@ export abstract class AbstractSchemaBuilder { } fromModel(maybeModel: MaybeIRModel, required: boolean): string { + + if (isRef(maybeModel)) { + return this.add(maybeModel) + } + const model = this.input.schema(maybeModel) switch (model.type) { diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.spec.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.spec.ts index 787ce0e45..cd6f0be6d 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.spec.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.spec.ts @@ -1,12 +1,13 @@ import {describe, it, expect} from "@jest/globals" import {JoiBuilder} from "./joi-schema-builder" +import {ImportBuilder} from "../../common/import-builder" describe("joi-schema-builder", () => { - const builder = new JoiBuilder("joi", { + const builder = new JoiBuilder("joi", "schemas.ts", { schema(it: unknown) { return it }, - } as any) + } as any, new ImportBuilder()) describe("for a string", () => { diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts index 341b1310a..73aca0526 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts @@ -16,12 +16,15 @@ enum JoiFn { export class JoiBuilder extends AbstractSchemaBuilder { constructor( private readonly joi = "joi", + filename: string, input: Input, + imports: ImportBuilder, ) { - super(input) + super(filename, input, imports) } - importHelpers(importBuilder: ImportBuilder) { + + protected importHelpers(importBuilder: ImportBuilder) { importBuilder.addModule(this.joi, "@hapi/joi") importBuilder.from("@nahkies/typescript-koa-runtime/joi") diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/schema-builder.ts index 3e63383d7..6f27a8a61 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/schema-builder.ts @@ -7,23 +7,15 @@ import {AbstractSchemaBuilder} from "./abstract-schema-builder" export type SchemaBuilder = AbstractSchemaBuilder export type SchemaBuilderType = "zod" | "joi" -function createSchemaBuilder(schemaBuilderType: SchemaBuilderType, input: Input) { +export function schemaBuilderFactory(schemaBuilderType: SchemaBuilderType, input: Input, importBuilder: ImportBuilder): AbstractSchemaBuilder { switch (schemaBuilderType) { case "joi": { - return new JoiBuilder("joi", input) + return new JoiBuilder("joi", "./schemas.ts", input, importBuilder) } case "zod": { - return new ZodBuilder("z", input) + return new ZodBuilder("z", "./schemas.ts", input, importBuilder) } default: throw new Error(`schemaBuilderType '${schemaBuilderType}' not recognized`) } } - -export function schemaBuilderFactory(schemaBuilderType: "zod" | "joi", input: Input, importBuilder: ImportBuilder): AbstractSchemaBuilder { - const schemaBuilder = createSchemaBuilder(schemaBuilderType, input) - - schemaBuilder.importHelpers(importBuilder) - - return schemaBuilder -} diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts index 6835b68a1..4fe6cd4e8 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts @@ -1,13 +1,14 @@ import {describe, it, expect} from "@jest/globals" import {ZodBuilder} from "./zod-schema-builder" import {unitTestInput} from "../../../test/input.test-utils" +import {ImportBuilder} from "../../common/import-builder" describe("zod-schema-builder", () => { it("supports unions / oneOf", async () => { const {input, file} = await unitTestInput() const schema = input.schema({$ref: `${file}#components/schemas/OneOf`}) - const builder = new ZodBuilder("z", input) + const builder = new ZodBuilder("z", "schemas.ts", input, new ImportBuilder()) const actual = builder.fromModel(schema, true) @@ -24,7 +25,7 @@ describe("zod-schema-builder", () => { const {input, file} = await unitTestInput() const schema = input.schema({$ref: `${file}#components/schemas/AllOf`}) - const builder = new ZodBuilder("z", input) + const builder = new ZodBuilder("z", "schemas.ts", input, new ImportBuilder()) const actual = builder.fromModel(schema, true) diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts index 0a27afbe6..c7ded85b8 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts @@ -9,19 +9,23 @@ import {ImportBuilder} from "../../common/import-builder" export class ZodBuilder extends AbstractSchemaBuilder { constructor( private readonly zod = "z", + filename: string, input: Input, + imports: ImportBuilder, ) { - super(input) - } + super(filename, input, imports) - importHelpers(importBuilder: ImportBuilder) { - importBuilder.from("zod") + imports.from("zod") .add(this.zod) - importBuilder.from("@nahkies/typescript-koa-runtime/zod") + imports.from("@nahkies/typescript-koa-runtime/zod") .add("parseRequestInput", "Params", "responseValidationFactory") } + protected importHelpers(imports: ImportBuilder) { + imports.from("zod") + .add(this.zod) + } protected intersect(schemas: string[]): string { return schemas.filter(isDefined).reduce((acc, it) => { diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index 7b30db80b..e2dc4a05a 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -30,10 +30,6 @@ function reduceParamsToOpenApiSchema(parameters: IRParameter[]): IRModelObject { } export class ServerBuilder { - private readonly imports: ImportBuilder - private readonly models: ModelBuilder - private readonly schemaBuilder: SchemaBuilder - private readonly statements: string[] = [] private readonly operationTypeMap: Record = {} @@ -41,11 +37,11 @@ export class ServerBuilder { public readonly filename: string, private readonly name: string, private readonly input: Input, - models: ModelBuilder, + private readonly imports: ImportBuilder, + public readonly models: ModelBuilder, + public readonly schemaBuilder: SchemaBuilder, private existingRegions: { [operationId: string]: string }, - schemaBuilderType: "zod" | "joi" = "zod", ) { - this.imports = new ImportBuilder() // TODO: unsure why, but adding an export at `.` of index.ts doesn't work properly this.imports.from("@nahkies/typescript-koa-runtime/server") .add("startServer", "ServerConfig", @@ -61,9 +57,6 @@ export class ServerBuilder { .add("Context") this.imports.addModule("KoaRouter", "@koa/router") - - this.schemaBuilder = schemaBuilderFactory(schemaBuilderType, this.input, this.imports) - this.models = models.withImports(this.imports) } add(operation: IROperation): void { @@ -210,8 +203,19 @@ function route(route: string): string { } export async function generateTypescriptKoa({ dest, input }: { dest: string, input: Input }): Promise { - const models = ModelBuilder.fromInput("./models.ts", input) - const server = new ServerBuilder("generated.ts", "ApiClient", input, models, loadExistingImplementations(await loadPreviousResult(dest, { filename: "index.ts" }))) + const imports = new ImportBuilder() + const models = ModelBuilder.fromInput("./models.ts", input).withImports(imports) + const schemaBuilder = schemaBuilderFactory("zod", input, imports) + + const server = new ServerBuilder( + "generated.ts", + "ApiClient", + input, + imports, + models, + schemaBuilder, + loadExistingImplementations(await loadPreviousResult(dest, { filename: "index.ts" })) + ) input.allOperations() .map(it => server.add(it)) @@ -219,6 +223,7 @@ export async function generateTypescriptKoa({ dest, input }: { dest: string, inp await emitGenerationResult(dest, [ models, server, + schemaBuilder, ]) } From 728ec36e851e676e3f836b11bd912e904ddff4d5 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 19:06:04 +0100 Subject: [PATCH 07/10] fix: tests --- .../abstract-schema-builder.ts | 7 +--- .../zod-schema-builder.spec.ts | 39 +++++++++++++------ 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts index a37a8460e..17b02a631 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts @@ -44,12 +44,7 @@ export abstract class AbstractSchemaBuilder { const imports = new ImportBuilder() this.importHelpers(imports) - return ` - - ${imports.toString()} - - ${next.join("\n\n")} - ` + return `${imports.toString()}\n${next.join("\n\n")}` } private generateSchemaFromRef($ref: string): string { diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts index 4fe6cd4e8..a09f9ebde 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts @@ -1,14 +1,19 @@ -import {describe, it, expect} from "@jest/globals" -import {ZodBuilder} from "./zod-schema-builder" -import {unitTestInput} from "../../../test/input.test-utils" -import {ImportBuilder} from "../../common/import-builder" +import { describe, it, expect } from "@jest/globals" +import { ZodBuilder } from "./zod-schema-builder" +import { unitTestInput } from "../../../test/input.test-utils" +import { ImportBuilder } from "../../common/import-builder" describe("zod-schema-builder", () => { it("supports unions / oneOf", async () => { - const {input, file} = await unitTestInput() - const schema = input.schema({$ref: `${file}#components/schemas/OneOf`}) + const { input, file } = await unitTestInput() + const schema = input.schema({ $ref: `${file}#components/schemas/OneOf` }) - const builder = new ZodBuilder("z", "schemas.ts", input, new ImportBuilder()) + const builder = new ZodBuilder( + "z", + "schemas.ts", + input, + new ImportBuilder() + ) const actual = builder.fromModel(schema, true) @@ -22,16 +27,28 @@ describe("zod-schema-builder", () => { }) it("supports allOf", async () => { - const {input, file} = await unitTestInput() - const schema = input.schema({$ref: `${file}#components/schemas/AllOf`}) + const { input, file } = await unitTestInput() + const schema = input.schema({ $ref: `${file}#components/schemas/AllOf` }) - const builder = new ZodBuilder("z", "schemas.ts", input, new ImportBuilder()) + const builder = new ZodBuilder( + "z", + "schemas.ts", + input, + new ImportBuilder() + ) const actual = builder.fromModel(schema, true) expect(actual).toMatchInlineSnapshot(` - "z.object({"name": z.coerce.string(),"breed": z.coerce.string().optional()}) + "s_Base .merge(z.object({"id": z.coerce.number()}))" `) + + expect(builder.toString()).toMatchInlineSnapshot(` + "import {z} from 'zod' + + export const s_Base = z.object({"name": z.coerce.string(),"breed": z.coerce.string().optional()}) + " + `) }) }) From b3b84cf5e88e2705480aab0c756b9b607b4b5c13 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 19:14:46 +0100 Subject: [PATCH 08/10] add a todo --- .../typescript-koa/schema-builders/zod-schema-builder.ts | 3 +++ .../src/typescript/typescript-koa/typescript-koa.generator.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts index c7ded85b8..9d370b980 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.ts @@ -6,6 +6,9 @@ import {isDefined} from "../../../core/utils" import {AbstractSchemaBuilder} from "./abstract-schema-builder" import {ImportBuilder} from "../../common/import-builder" +// TODO: coerce is cool for input where everything starts as strings, +// but for output we probably don't want that as its more likely +// to mask mistakes. https://en.wikipedia.org/wiki/Robustness_principle export class ZodBuilder extends AbstractSchemaBuilder { constructor( private readonly zod = "z", diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index e2dc4a05a..9b349edbe 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -44,7 +44,9 @@ export class ServerBuilder { ) { // TODO: unsure why, but adding an export at `.` of index.ts doesn't work properly this.imports.from("@nahkies/typescript-koa-runtime/server") - .add("startServer", "ServerConfig", + .add( + "startServer", + "ServerConfig", "Response", "StatusCode2xx", "StatusCode3xx", From eea4dd94c5412eaf9e7da27eff2f24678c367e5d Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 19:37:58 +0100 Subject: [PATCH 09/10] fix: don't recreate response validation on every req --- .../src/api.github.com.yaml/generated.ts | 76845 ++++++++-------- .../src/petstore-expanded.yml/generated.ts | 40 +- .../src/todo-lists.yml/generated.ts | 86 +- .../typescript-koa.generator.ts | 66 +- 4 files changed, 39734 insertions(+), 37303 deletions(-) diff --git a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts index 7f0960eba..ce0374320 100644 --- a/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts +++ b/integration-tests/typescript-koa/src/api.github.com.yaml/generated.ts @@ -11786,6 +11786,11 @@ export function bootstrap( // ApiClient const router = new KoaRouter() + const metaRootResponseValidator = responseValidationFactory( + [["200", s_root]], + undefined + ) + router.get("metaRoot", "/", async (ctx, next) => { const input = { params: undefined, @@ -11795,14 +11800,16 @@ export function bootstrap( const { status, body } = await implementation.metaRoot(input, ctx) - ctx.body = responseValidationFactory([["200", s_root]], undefined)( - status, - body - ) + ctx.body = metaRootResponseValidator(status, body) ctx.status = status return next() }) + const appsGetAuthenticatedResponseValidator = responseValidationFactory( + [["200", s_integration]], + undefined + ) + router.get("appsGetAuthenticated", "/app", async (ctx, next) => { const input = { params: undefined, @@ -11815,10 +11822,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_integration]], undefined)( - status, - body - ) + ctx.body = appsGetAuthenticatedResponseValidator(status, body) ctx.status = status return next() }) @@ -11827,6 +11831,25 @@ export function bootstrap( code: z.coerce.string(), }) + const appsCreateFromManifestResponseValidator = responseValidationFactory( + [ + [ + "201", + s_integration.merge( + z.object({ + client_id: z.coerce.string(), + client_secret: z.coerce.string(), + webhook_secret: z.coerce.string(), + pem: z.coerce.string(), + }) + ), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "appsCreateFromManifest", "/app-manifests/:code/conversions", @@ -11845,29 +11868,17 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "201", - s_integration.merge( - z.object({ - client_id: z.coerce.string(), - client_secret: z.coerce.string(), - webhook_secret: z.coerce.string(), - pem: z.coerce.string(), - }) - ), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = appsCreateFromManifestResponseValidator(status, body) ctx.status = status return next() } ) + const appsGetWebhookConfigForAppResponseValidator = responseValidationFactory( + [["200", s_webhook_config]], + undefined + ) + router.get( "appsGetWebhookConfigForApp", "/app/hook/config", @@ -11883,10 +11894,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_webhook_config]], - undefined - )(status, body) + ctx.body = appsGetWebhookConfigForAppResponseValidator(status, body) ctx.status = status return next() } @@ -11899,6 +11907,9 @@ export function bootstrap( insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), }) + const appsUpdateWebhookConfigForAppResponseValidator = + responseValidationFactory([["200", s_webhook_config]], undefined) + router.patch( "appsUpdateWebhookConfigForApp", "/app/hook/config", @@ -11915,10 +11926,7 @@ export function bootstrap( const { status, body } = await implementation.appsUpdateWebhookConfigForApp(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_webhook_config]], - undefined - )(status, body) + ctx.body = appsUpdateWebhookConfigForAppResponseValidator(status, body) ctx.status = status return next() } @@ -11930,6 +11938,32 @@ export function bootstrap( redelivery: z.coerce.boolean().optional(), }) + const appsListWebhookDeliveriesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), + ], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "appsListWebhookDeliveries", "/app/hook/deliveries", @@ -11948,31 +11982,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ), - ], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsListWebhookDeliveriesResponseValidator(status, body) ctx.status = status return next() } @@ -11982,6 +11992,15 @@ export function bootstrap( delivery_id: z.coerce.number(), }) + const appsGetWebhookDeliveryResponseValidator = responseValidationFactory( + [ + ["200", s_hook_delivery], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "appsGetWebhookDelivery", "/app/hook/deliveries/:deliveryId", @@ -12000,14 +12019,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_hook_delivery], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsGetWebhookDeliveryResponseValidator(status, body) ctx.status = status return next() } @@ -12017,6 +12029,16 @@ export function bootstrap( delivery_id: z.coerce.number(), }) + const appsRedeliverWebhookDeliveryResponseValidator = + responseValidationFactory( + [ + ["202", z.object({})], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "appsRedeliverWebhookDelivery", "/app/hook/deliveries/:deliveryId/attempts", @@ -12033,14 +12055,7 @@ export function bootstrap( const { status, body } = await implementation.appsRedeliverWebhookDelivery(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsRedeliverWebhookDeliveryResponseValidator(status, body) ctx.status = status return next() } @@ -12053,6 +12068,105 @@ export function bootstrap( outdated: z.coerce.string().optional(), }) + const appsListInstallationsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z.enum(["read", "write"]).optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z.enum(["read", "write"]).optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "appsListInstallations", "/app/installations", @@ -12068,110 +12182,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z.enum(["read", "write"]).optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = appsListInstallationsResponseValidator(status, body) ctx.status = status return next() } @@ -12181,6 +12192,14 @@ export function bootstrap( installation_id: z.coerce.number(), }) + const appsGetInstallationResponseValidator = responseValidationFactory( + [ + ["200", s_installation], + ["404", s_basic_error], + ], + undefined + ) + router.get( "appsGetInstallation", "/app/installations/:installationId", @@ -12196,13 +12215,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_installation], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsGetInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -12212,6 +12225,14 @@ export function bootstrap( installation_id: z.coerce.number(), }) + const appsDeleteInstallationResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "appsDeleteInstallation", "/app/installations/:installationId", @@ -12230,13 +12251,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsDeleteInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -12294,6 +12309,18 @@ export function bootstrap( }) .optional() + const appsCreateInstallationAccessTokenResponseValidator = + responseValidationFactory( + [ + ["201", s_installation_token], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "appsCreateInstallationAccessToken", "/app/installations/:installationId/access_tokens", @@ -12313,16 +12340,10 @@ export function bootstrap( const { status, body } = await implementation.appsCreateInstallationAccessToken(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_installation_token], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsCreateInstallationAccessTokenResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12332,6 +12353,14 @@ export function bootstrap( installation_id: z.coerce.number(), }) + const appsSuspendInstallationResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.put( "appsSuspendInstallation", "/app/installations/:installationId/suspended", @@ -12350,13 +12379,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsSuspendInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -12366,6 +12389,14 @@ export function bootstrap( installation_id: z.coerce.number(), }) + const appsUnsuspendInstallationResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "appsUnsuspendInstallation", "/app/installations/:installationId/suspended", @@ -12384,13 +12415,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsUnsuspendInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -12404,6 +12429,14 @@ export function bootstrap( access_token: z.coerce.string(), }) + const appsDeleteAuthorizationResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "appsDeleteAuthorization", "/applications/:clientId/grant", @@ -12422,13 +12455,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsDeleteAuthorizationResponseValidator(status, body) ctx.status = status return next() } @@ -12438,6 +12465,15 @@ export function bootstrap( const appsCheckTokenBodySchema = z.object({ access_token: z.coerce.string() }) + const appsCheckTokenResponseValidator = responseValidationFactory( + [ + ["200", s_authorization], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "appsCheckToken", "/applications/:clientId/token", @@ -12450,14 +12486,7 @@ export function bootstrap( const { status, body } = await implementation.appsCheckToken(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_authorization], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsCheckTokenResponseValidator(status, body) ctx.status = status return next() } @@ -12467,6 +12496,14 @@ export function bootstrap( const appsResetTokenBodySchema = z.object({ access_token: z.coerce.string() }) + const appsResetTokenResponseValidator = responseValidationFactory( + [ + ["200", s_authorization], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "appsResetToken", "/applications/:clientId/token", @@ -12479,13 +12516,7 @@ export function bootstrap( const { status, body } = await implementation.appsResetToken(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_authorization], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsResetTokenResponseValidator(status, body) ctx.status = status return next() } @@ -12497,6 +12528,14 @@ export function bootstrap( access_token: z.coerce.string(), }) + const appsDeleteTokenResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "appsDeleteToken", "/applications/:clientId/token", @@ -12509,13 +12548,7 @@ export function bootstrap( const { status, body } = await implementation.appsDeleteToken(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsDeleteTokenResponseValidator(status, body) ctx.status = status return next() } @@ -12568,6 +12601,17 @@ export function bootstrap( .optional(), }) + const appsScopeTokenResponseValidator = responseValidationFactory( + [ + ["200", s_authorization], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "appsScopeToken", "/applications/:clientId/token/scoped", @@ -12580,16 +12624,7 @@ export function bootstrap( const { status, body } = await implementation.appsScopeToken(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_authorization], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = appsScopeTokenResponseValidator(status, body) ctx.status = status return next() } @@ -12597,6 +12632,15 @@ export function bootstrap( const appsGetBySlugParamSchema = z.object({ app_slug: z.coerce.string() }) + const appsGetBySlugResponseValidator = responseValidationFactory( + [ + ["200", s_integration], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get("appsGetBySlug", "/apps/:appSlug", async (ctx, next) => { const input = { params: parseRequestInput(appsGetBySlugParamSchema, ctx.params), @@ -12606,18 +12650,31 @@ export function bootstrap( const { status, body } = await implementation.appsGetBySlug(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_integration], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsGetBySlugResponseValidator(status, body) ctx.status = status return next() }) + const codesOfConductGetAllCodesOfConductResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ], + undefined + ) + router.get( "codesOfConductGetAllCodesOfConduct", "/codes_of_conduct", @@ -12631,24 +12688,10 @@ export function bootstrap( const { status, body } = await implementation.codesOfConductGetAllCodesOfConduct(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = codesOfConductGetAllCodesOfConductResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12658,6 +12701,16 @@ export function bootstrap( key: z.coerce.string(), }) + const codesOfConductGetConductCodeResponseValidator = + responseValidationFactory( + [ + ["200", s_code_of_conduct], + ["304", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get( "codesOfConductGetConductCode", "/codes_of_conduct/:key", @@ -12674,19 +12727,20 @@ export function bootstrap( const { status, body } = await implementation.codesOfConductGetConductCode(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_code_of_conduct], - ["304", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codesOfConductGetConductCodeResponseValidator(status, body) ctx.status = status return next() } ) + const emojisGetResponseValidator = responseValidationFactory( + [ + ["200", z.object({})], + ["304", z.void()], + ], + undefined + ) + router.get("emojisGet", "/emojis", async (ctx, next) => { const input = { params: undefined, @@ -12696,13 +12750,7 @@ export function bootstrap( const { status, body } = await implementation.emojisGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.object({})], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = emojisGetResponseValidator(status, body) ctx.status = status return next() }) @@ -12710,6 +12758,9 @@ export function bootstrap( const enterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseParamSchema = z.object({ enterprise: z.coerce.string(), org_id: z.coerce.number() }) + const enterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise", "/enterprises/:enterprise/actions/permissions/organizations/:orgId", @@ -12729,10 +12780,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + enterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12748,6 +12800,33 @@ export function bootstrap( visible_to_organization: z.coerce.string().optional(), }) + const enterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runner_groups: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_organizations_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "enterpriseAdminListSelfHostedRunnerGroupsForEnterprise", "/enterprises/:enterprise/actions/runner-groups", @@ -12770,33 +12849,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - runner_groups: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_organizations_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce - .boolean() - .optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = + enterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12816,6 +12873,9 @@ export function bootstrap( selected_workflows: z.array(z.coerce.string()).optional(), }) + const enterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseResponseValidator = + responseValidationFactory([["201", s_runner_groups_enterprise]], undefined) + router.post( "enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise", "/enterprises/:enterprise/actions/runner-groups", @@ -12838,10 +12898,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_runner_groups_enterprise]], - undefined - )(status, body) + ctx.body = + enterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12853,6 +12914,9 @@ export function bootstrap( runner_group_id: z.coerce.number(), }) + const enterpriseAdminGetSelfHostedRunnerGroupForEnterpriseResponseValidator = + responseValidationFactory([["200", s_runner_groups_enterprise]], undefined) + router.get( "enterpriseAdminGetSelfHostedRunnerGroupForEnterprise", "/enterprises/:enterprise/actions/runner-groups/:runnerGroupId", @@ -12872,10 +12936,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_runner_groups_enterprise]], - undefined - )(status, body) + ctx.body = + enterpriseAdminGetSelfHostedRunnerGroupForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12888,6 +12953,9 @@ export function bootstrap( org_id: z.coerce.number(), }) + const enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise", "/enterprises/:enterprise/actions/runner-groups/:runnerGroupId/organizations/:orgId", @@ -12907,10 +12975,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12923,6 +12992,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise", "/enterprises/:enterprise/actions/runner-groups/:runnerGroupId/runners/:runnerId", @@ -12942,10 +13014,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12954,6 +13027,9 @@ export function bootstrap( const enterpriseAdminDeleteSelfHostedRunnerFromEnterpriseParamSchema = z.object({ enterprise: z.coerce.string(), runner_id: z.coerce.number() }) + const enterpriseAdminDeleteSelfHostedRunnerFromEnterpriseResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "enterpriseAdminDeleteSelfHostedRunnerFromEnterprise", "/enterprises/:enterprise/actions/runners/:runnerId", @@ -12973,10 +13049,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + enterpriseAdminDeleteSelfHostedRunnerFromEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -12985,6 +13062,27 @@ export function bootstrap( const enterpriseAdminListLabelsForSelfHostedRunnerForEnterpriseParamSchema = z.object({ enterprise: z.coerce.string(), runner_id: z.coerce.number() }) + const enterpriseAdminListLabelsForSelfHostedRunnerForEnterpriseResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "enterpriseAdminListLabelsForSelfHostedRunnerForEnterprise", "/enterprises/:enterprise/actions/runners/:runnerId/labels", @@ -13004,25 +13102,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + enterpriseAdminListLabelsForSelfHostedRunnerForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -13034,6 +13118,28 @@ export function bootstrap( const enterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterpriseBodySchema = z.object({ labels: z.array(z.coerce.string()) }) + const enterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterpriseResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "enterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterprise", "/enterprises/:enterprise/actions/runners/:runnerId/labels", @@ -13056,26 +13162,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + enterpriseAdminAddCustomLabelsToSelfHostedRunnerForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -13084,6 +13175,15 @@ export function bootstrap( const secretScanningGetSecurityAnalysisSettingsForEnterpriseParamSchema = z.object({ enterprise: z.coerce.string() }) + const secretScanningGetSecurityAnalysisSettingsForEnterpriseResponseValidator = + responseValidationFactory( + [ + ["200", s_enterprise_security_analysis_settings], + ["404", s_basic_error], + ], + undefined + ) + router.get( "secretScanningGetSecurityAnalysisSettingsForEnterprise", "/enterprises/:enterprise/code_security_and_analysis", @@ -13103,13 +13203,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_enterprise_security_analysis_settings], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + secretScanningGetSecurityAnalysisSettingsForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -13133,6 +13231,16 @@ export function bootstrap( }) .optional() + const secretScanningPatchSecurityAnalysisSettingsForEnterpriseResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", z.void()], + ], + undefined + ) + router.patch( "secretScanningPatchSecurityAnalysisSettingsForEnterprise", "/enterprises/:enterprise/code_security_and_analysis", @@ -13155,14 +13263,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = + secretScanningPatchSecurityAnalysisSettingsForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -13187,6 +13292,194 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const dependabotListAlertsForEnterpriseResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.get( "dependabotListAlertsForEnterprise", "/enterprises/:enterprise/dependabot/alerts", @@ -13206,81 +13499,65 @@ export function bootstrap( const { status, body } = await implementation.dependabotListAlertsForEnterprise(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = dependabotListAlertsForEnterpriseResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const secretScanningListAlertsForEnterpriseParamSchema = z.object({ + enterprise: z.coerce.string(), + }) + + const secretScanningListAlertsForEnterpriseQuerySchema = z.object({ + state: z.enum(["open", "resolved"]).optional(), + secret_type: z.coerce.string().optional(), + resolution: z.coerce.string().optional(), + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + before: z.coerce.string().optional(), + after: z.coerce.string().optional(), + }) + + const secretScanningListAlertsForEnterpriseResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ + "200", + z.array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -13302,17 +13579,13 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ + }) + .optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + repository: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), @@ -13381,36 +13654,54 @@ export function bootstrap( teams_url: z.coerce.string(), trees_url: z.coerce.string(), hooks_url: z.coerce.string(), - }), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], + }) + .optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const secretScanningListAlertsForEnterpriseParamSchema = z.object({ - enterprise: z.coerce.string(), - }) - - const secretScanningListAlertsForEnterpriseQuerySchema = z.object({ - state: z.enum(["open", "resolved"]).optional(), - secret_type: z.coerce.string().optional(), - resolution: z.coerce.string().optional(), - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - before: z.coerce.string().optional(), - after: z.coerce.string().optional(), - }) + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) router.get( "secretScanningListAlertsForEnterprise", @@ -13431,184 +13722,10 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListAlertsForEnterprise(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }) - .optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolution_comment: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = secretScanningListAlertsForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -13625,6 +13742,16 @@ export function bootstrap( enablement: z.enum(["enable_all", "disable_all"]), }) + const secretScanningPostSecurityProductEnablementForEnterpriseResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", z.void()], + ], + undefined + ) + router.post( "secretScanningPostSecurityProductEnablementForEnterprise", "/enterprises/:enterprise/:securityProduct/:enablement", @@ -13644,14 +13771,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = + secretScanningPostSecurityProductEnablementForEnterpriseResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -13662,69 +13786,154 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("activityListPublicEvents", "/events", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(activityListPublicEventsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.activityListPublicEvents( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const activityListPublicEventsResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -13747,21 +13956,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -13783,10 +14005,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -13809,19 +14048,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -13844,601 +14082,478 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["403", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + + router.get("activityListPublicEvents", "/events", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(activityListPublicEventsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.activityListPublicEvents( + input, + ctx + ) + + ctx.body = activityListPublicEventsResponseValidator(status, body) ctx.status = status return next() }) + const activityGetFeedsResponseValidator = responseValidationFactory( + [["200", s_feed]], + undefined + ) + router.get("activityGetFeeds", "/feeds", async (ctx, next) => { const input = { params: undefined, @@ -14448,10 +14563,7 @@ export function bootstrap( const { status, body } = await implementation.activityGetFeeds(input, ctx) - ctx.body = responseValidationFactory([["200", s_feed]], undefined)( - status, - body - ) + ctx.body = activityGetFeedsResponseValidator(status, body) ctx.status = status return next() }) @@ -14462,36 +14574,52 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("gistsList", "/gists", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(gistsListQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsList(input, ctx) - - ctx.body = responseValidationFactory( + const gistsListResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), + "200", + z.array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -14513,44 +14641,30 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["403", s_basic_error], + ], + undefined + ) + + router.get("gistsList", "/gists", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(gistsListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gistsList(input, ctx) + + ctx.body = gistsListResponseValidator(status, body) ctx.status = status return next() }) @@ -14561,6 +14675,17 @@ export function bootstrap( public: z.union([z.coerce.boolean(), z.enum(["true", "false"])]), }) + const gistsCreateResponseValidator = responseValidationFactory( + [ + ["201", s_gist_simple], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post("gistsCreate", "/gists", async (ctx, next) => { const input = { params: undefined, @@ -14570,16 +14695,7 @@ export function bootstrap( const { status, body } = await implementation.gistsCreate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_gist_simple], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gistsCreateResponseValidator(status, body) ctx.status = status return next() }) @@ -14590,36 +14706,52 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("gistsListPublic", "/gists/public", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(gistsListPublicQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsListPublic(input, ctx) - - ctx.body = responseValidationFactory( + const gistsListPublicResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), + "200", + z.array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -14641,45 +14773,31 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["422", s_validation_error], + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.get("gistsListPublic", "/gists/public", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(gistsListPublicQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gistsListPublic(input, ctx) + + ctx.body = gistsListPublicResponseValidator(status, body) ctx.status = status return next() }) @@ -14690,36 +14808,52 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("gistsListStarred", "/gists/starred", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(gistsListStarredQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsListStarred(input, ctx) - - ctx.body = responseValidationFactory( + const gistsListStarredResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), + "200", + z.array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -14741,51 +14875,60 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + + router.get("gistsListStarred", "/gists/starred", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(gistsListStarredQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gistsListStarred(input, ctx) + + ctx.body = gistsListStarredResponseValidator(status, body) ctx.status = status return next() }) const gistsGetParamSchema = z.object({ gist_id: z.coerce.string() }) + const gistsGetResponseValidator = responseValidationFactory( + [ + ["200", s_gist_simple], + ["304", z.void()], + [ + "403", + z.object({ + block: z + .object({ + reason: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get("gistsGet", "/gists/:gistId", async (ctx, next) => { const input = { params: parseRequestInput(gistsGetParamSchema, ctx.params), @@ -14795,28 +14938,7 @@ export function bootstrap( const { status, body } = await implementation.gistsGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_gist_simple], - ["304", z.void()], - [ - "403", - z.object({ - block: z - .object({ - reason: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsGetResponseValidator(status, body) ctx.status = status return next() }) @@ -14828,6 +14950,15 @@ export function bootstrap( files: z.object({}).optional(), }) + const gistsUpdateResponseValidator = responseValidationFactory( + [ + ["200", s_gist_simple], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch("gistsUpdate", "/gists/:gistId", async (ctx, next) => { const input = { params: parseRequestInput(gistsUpdateParamSchema, ctx.params), @@ -14837,20 +14968,23 @@ export function bootstrap( const { status, body } = await implementation.gistsUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_gist_simple], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gistsUpdateResponseValidator(status, body) ctx.status = status return next() }) const gistsDeleteParamSchema = z.object({ gist_id: z.coerce.string() }) + const gistsDeleteResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete("gistsDelete", "/gists/:gistId", async (ctx, next) => { const input = { params: parseRequestInput(gistsDeleteParamSchema, ctx.params), @@ -14860,15 +14994,7 @@ export function bootstrap( const { status, body } = await implementation.gistsDelete(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsDeleteResponseValidator(status, body) ctx.status = status return next() }) @@ -14880,6 +15006,61 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const gistsListCommentsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "gistsListComments", "/gists/:gistId/comments", @@ -14895,60 +15076,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsListCommentsResponseValidator(status, body) ctx.status = status return next() } @@ -14958,6 +15086,16 @@ export function bootstrap( const gistsCreateCommentBodySchema = z.object({ body: z.coerce.string() }) + const gistsCreateCommentResponseValidator = responseValidationFactory( + [ + ["201", s_gist_comment], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "gistsCreateComment", "/gists/:gistId/comments", @@ -14973,15 +15111,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_gist_comment], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsCreateCommentResponseValidator(status, body) ctx.status = status return next() } @@ -14992,6 +15122,29 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const gistsGetCommentResponseValidator = responseValidationFactory( + [ + ["200", s_gist_comment], + ["304", z.void()], + [ + "403", + z.object({ + block: z + .object({ + reason: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + .optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "gistsGetComment", "/gists/:gistId/comments/:commentId", @@ -15004,28 +15157,7 @@ export function bootstrap( const { status, body } = await implementation.gistsGetComment(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_gist_comment], - ["304", z.void()], - [ - "403", - z.object({ - block: z - .object({ - reason: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - .optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsGetCommentResponseValidator(status, body) ctx.status = status return next() } @@ -15038,6 +15170,14 @@ export function bootstrap( const gistsUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) + const gistsUpdateCommentResponseValidator = responseValidationFactory( + [ + ["200", s_gist_comment], + ["404", s_basic_error], + ], + undefined + ) + router.patch( "gistsUpdateComment", "/gists/:gistId/comments/:commentId", @@ -15053,13 +15193,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_gist_comment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsUpdateCommentResponseValidator(status, body) ctx.status = status return next() } @@ -15070,6 +15204,16 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const gistsDeleteCommentResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "gistsDeleteComment", "/gists/:gistId/comments/:commentId", @@ -15085,15 +15229,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsDeleteCommentResponseValidator(status, body) ctx.status = status return next() } @@ -15106,6 +15242,53 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const gistsListCommitsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + version: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + change_status: z.object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }), + committed_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "gistsListCommits", "/gists/:gistId/commits", @@ -15118,52 +15301,7 @@ export function bootstrap( const { status, body } = await implementation.gistsListCommits(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - version: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - change_status: z.object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }), - committed_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsListCommitsResponseValidator(status, body) ctx.status = status return next() } @@ -15176,179 +15314,85 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("gistsListForks", "/gists/:gistId/forks", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsListForksParamSchema, ctx.params), - query: parseRequestInput(gistsListForksQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.gistsListForks(input, ctx) - - ctx.body = responseValidationFactory( + const gistsListForksResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - forks: z - .array( - z.object({ - id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - user: z - .object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - name: z.coerce.string(), - company: z.coerce.string(), - blog: z.coerce.string(), - location: z.coerce.string(), - email: z.coerce.string().email(), - hireable: z.coerce.boolean(), - bio: z.coerce.string(), - twitter_username: z.coerce.string().optional(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - plan: z - .object({ - collaborators: z.coerce.number(), - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - }) - .optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - private_gists: z.coerce.number().optional(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - history: z - .array( - z.object({ - user: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - version: z.coerce.string().optional(), - committed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - change_status: z - .object({ - total: z.coerce.number().optional(), - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - }) - .optional(), - url: z.coerce.string().optional(), - }) - ) - .optional(), - fork_of: z - .object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z + "200", + z.array( + z.object({ + forks: z + .array( + z.object({ + id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + user: z + .object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + name: z.coerce.string(), + company: z.coerce.string(), + blog: z.coerce.string(), + location: z.coerce.string(), + email: z.coerce.string().email(), + hireable: z.coerce.boolean(), + bio: z.coerce.string(), + twitter_username: z.coerce.string().optional(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + plan: z + .object({ + collaborators: z.coerce.number(), + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + }) + .optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + private_gists: z.coerce.number().optional(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + history: z + .array( + z.object({ + user: z .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -15373,29 +15417,39 @@ export function bootstrap( starred_at: z.coerce.string().optional(), }) .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), + version: z.coerce.string().optional(), + committed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + change_status: z + .object({ + total: z.coerce.number().optional(), + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + }) + .optional(), + url: z.coerce.string().optional(), }) - .optional(), - url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - id: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - git_pull_url: z.coerce.string().optional(), - git_push_url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - files: z.object({}).optional(), - public: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - description: z.coerce.string().optional(), - comments: z.coerce.number().optional(), - user: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - owner: z - .object({ + ) + .optional(), + fork_of: z + .object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15417,43 +15471,127 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const gistsForkParamSchema = z.object({ gist_id: z.coerce.string() }) - - router.post("gistsFork", "/gists/:gistId/forks", async (ctx, next) => { - const input = { - params: parseRequestInput(gistsForkParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.gistsFork(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["201", s_base_gist], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + .optional(), + url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + id: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + git_pull_url: z.coerce.string().optional(), + git_push_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + files: z.object({}).optional(), + public: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + comments: z.coerce.number().optional(), + user: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get("gistsListForks", "/gists/:gistId/forks", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsListForksParamSchema, ctx.params), + query: parseRequestInput(gistsListForksQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.gistsListForks(input, ctx) + + ctx.body = gistsListForksResponseValidator(status, body) + ctx.status = status + return next() + }) + + const gistsForkParamSchema = z.object({ gist_id: z.coerce.string() }) + + const gistsForkResponseValidator = responseValidationFactory( + [ + ["201", s_base_gist], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.post("gistsFork", "/gists/:gistId/forks", async (ctx, next) => { + const input = { + params: parseRequestInput(gistsForkParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.gistsFork(input, ctx) + + ctx.body = gistsForkResponseValidator(status, body) ctx.status = status return next() }) @@ -15462,6 +15600,16 @@ export function bootstrap( gist_id: z.coerce.string(), }) + const gistsCheckIsStarredResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", z.object({})], + ], + undefined + ) + router.get( "gistsCheckIsStarred", "/gists/:gistId/star", @@ -15477,15 +15625,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", z.object({})], - ], - undefined - )(status, body) + ctx.body = gistsCheckIsStarredResponseValidator(status, body) ctx.status = status return next() } @@ -15493,6 +15633,16 @@ export function bootstrap( const gistsStarParamSchema = z.object({ gist_id: z.coerce.string() }) + const gistsStarResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.put("gistsStar", "/gists/:gistId/star", async (ctx, next) => { const input = { params: parseRequestInput(gistsStarParamSchema, ctx.params), @@ -15502,21 +15652,23 @@ export function bootstrap( const { status, body } = await implementation.gistsStar(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsStarResponseValidator(status, body) ctx.status = status return next() }) const gistsUnstarParamSchema = z.object({ gist_id: z.coerce.string() }) + const gistsUnstarResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete("gistsUnstar", "/gists/:gistId/star", async (ctx, next) => { const input = { params: parseRequestInput(gistsUnstarParamSchema, ctx.params), @@ -15526,15 +15678,7 @@ export function bootstrap( const { status, body } = await implementation.gistsUnstar(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gistsUnstarResponseValidator(status, body) ctx.status = status return next() }) @@ -15544,6 +15688,16 @@ export function bootstrap( sha: z.coerce.string(), }) + const gistsGetRevisionResponseValidator = responseValidationFactory( + [ + ["200", s_gist_simple], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get("gistsGetRevision", "/gists/:gistId/:sha", async (ctx, next) => { const input = { params: parseRequestInput(gistsGetRevisionParamSchema, ctx.params), @@ -15553,19 +15707,19 @@ export function bootstrap( const { status, body } = await implementation.gistsGetRevision(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_gist_simple], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gistsGetRevisionResponseValidator(status, body) ctx.status = status return next() }) + const gitignoreGetAllTemplatesResponseValidator = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["304", z.void()], + ], + undefined + ) + router.get( "gitignoreGetAllTemplates", "/gitignore/templates", @@ -15581,13 +15735,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = gitignoreGetAllTemplatesResponseValidator(status, body) ctx.status = status return next() } @@ -15595,6 +15743,14 @@ export function bootstrap( const gitignoreGetTemplateParamSchema = z.object({ name: z.coerce.string() }) + const gitignoreGetTemplateResponseValidator = responseValidationFactory( + [ + ["200", s_gitignore_template], + ["304", z.void()], + ], + undefined + ) + router.get( "gitignoreGetTemplate", "/gitignore/templates/:name", @@ -15610,13 +15766,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_gitignore_template], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = gitignoreGetTemplateResponseValidator(status, body) ctx.status = status return next() } @@ -15627,78 +15777,29 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "appsListReposAccessibleToInstallation", - "/installation/repositories", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - appsListReposAccessibleToInstallationQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.appsListReposAccessibleToInstallation(input, ctx) - - ctx.body = responseValidationFactory( + const appsListReposAccessibleToInstallationResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -15720,320 +15821,466 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - repository_selection: z.coerce.string().optional(), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - router.delete( - "appsRevokeInstallationAccessToken", - "/installation/token", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.appsRevokeInstallationAccessToken(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const issuesListQuerySchema = z.object({ - filter: z - .enum(["assigned", "created", "mentioned", "subscribed", "repos", "all"]) - .optional(), - state: z.enum(["open", "closed", "all"]).optional(), - labels: z.coerce.string().optional(), - sort: z.enum(["created", "updated", "comments"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - collab: z.coerce.boolean().optional(), - orgs: z.coerce.boolean().optional(), - owned: z.coerce.boolean().optional(), - pulls: z.coerce.boolean().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + repository_selection: z.coerce.string().optional(), + }), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) - router.get("issuesList", "/issues", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(issuesListQuerySchema, ctx.query), - body: undefined, + router.get( + "appsListReposAccessibleToInstallation", + "/installation/repositories", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListReposAccessibleToInstallationQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.appsListReposAccessibleToInstallation(input, ctx) + + ctx.body = appsListReposAccessibleToInstallationResponseValidator( + status, + body + ) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.issuesList(input, ctx) + const appsRevokeInstallationAccessTokenResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + + router.delete( + "appsRevokeInstallationAccessToken", + "/installation/token", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.appsRevokeInstallationAccessToken(input, ctx) + + ctx.body = appsRevokeInstallationAccessTokenResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) - ctx.body = responseValidationFactory( + const issuesListQuerySchema = z.object({ + filter: z + .enum(["assigned", "created", "mentioned", "subscribed", "repos", "all"]) + .optional(), + state: z.enum(["open", "closed", "all"]).optional(), + labels: z.coerce.string().optional(), + sort: z.enum(["created", "updated", "comments"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + collab: z.coerce.boolean().optional(), + orgs: z.coerce.boolean().optional(), + owned: z.coerce.boolean().optional(), + pulls: z.coerce.boolean().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const issuesListResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -16056,21 +16303,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -16092,10 +16352,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -16118,19 +16395,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -16153,44 +16429,251 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), following_url: z.coerce.string(), gists_url: z.coerce.string(), starred_url: z.coerce.string(), @@ -16202,525 +16685,419 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["304", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.get("issuesList", "/issues", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(issuesListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesList(input, ctx) + + ctx.body = issuesListResponseValidator(status, body) + ctx.status = status + return next() + }) + + const licensesGetAllCommonlyUsedQuerySchema = z.object({ + featured: z.coerce.boolean().optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const licensesGetAllCommonlyUsedResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ], + undefined + ) + + router.get("licensesGetAllCommonlyUsed", "/licenses", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + licensesGetAllCommonlyUsedQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.licensesGetAllCommonlyUsed( + input, + ctx + ) + + ctx.body = licensesGetAllCommonlyUsedResponseValidator(status, body) + ctx.status = status + return next() + }) + + const licensesGetParamSchema = z.object({ license: z.coerce.string() }) + + const licensesGetResponseValidator = responseValidationFactory( + [ + ["200", s_license], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get("licensesGet", "/licenses/:license", async (ctx, next) => { + const input = { + params: parseRequestInput(licensesGetParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.licensesGet(input, ctx) + + ctx.body = licensesGetResponseValidator(status, body) + ctx.status = status + return next() + }) + + const markdownRenderBodySchema = z.object({ + text: z.coerce.string(), + mode: z.enum(["markdown", "gfm"]).optional(), + context: z.coerce.string().optional(), + }) + + const markdownRenderResponseValidator = responseValidationFactory( + [ + ["200", z.coerce.string()], + ["304", z.void()], + ], + undefined + ) + + router.post("markdownRender", "/markdown", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput(markdownRenderBodySchema, ctx.body), + } + + const { status, body } = await implementation.markdownRender(input, ctx) + + ctx.body = markdownRenderResponseValidator(status, body) + ctx.status = status + return next() + }) + + const markdownRenderRawBodySchema = z.coerce.string().optional() + + const markdownRenderRawResponseValidator = responseValidationFactory( + [ + ["200", z.coerce.string()], + ["304", z.void()], + ], + undefined + ) + + router.post("markdownRenderRaw", "/markdown/raw", async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput(markdownRenderRawBodySchema, ctx.body), + } + + const { status, body } = await implementation.markdownRenderRaw(input, ctx) + + ctx.body = markdownRenderRawResponseValidator(status, body) + ctx.status = status + return next() + }) + + const appsGetSubscriptionPlanForAccountParamSchema = z.object({ + account_id: z.coerce.number(), + }) + + const appsGetSubscriptionPlanForAccountResponseValidator = + responseValidationFactory( + [ + ["200", s_marketplace_purchase], + ["401", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "appsGetSubscriptionPlanForAccount", + "/marketplace_listing/accounts/:accountId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsGetSubscriptionPlanForAccountParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.appsGetSubscriptionPlanForAccount(input, ctx) + + ctx.body = appsGetSubscriptionPlanForAccountResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const appsListPlansQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const appsListPlansResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ), + ], + ["401", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "appsListPlans", + "/marketplace_listing/plans", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(appsListPlansQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.appsListPlans(input, ctx) + + ctx.body = appsListPlansResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const appsListAccountsForPlanParamSchema = z.object({ + plan_id: z.coerce.number(), + }) + + const appsListAccountsForPlanQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const appsListAccountsForPlanResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ + is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), + unit_count: z.coerce.number().optional(), + id: z.coerce.number().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), + number: z.coerce.number(), name: z.coerce.string(), description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), }) .optional(), - }) - ), - ], - ["304", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const licensesGetAllCommonlyUsedQuerySchema = z.object({ - featured: z.coerce.boolean().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get("licensesGetAllCommonlyUsed", "/licenses", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - licensesGetAllCommonlyUsedQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.licensesGetAllCommonlyUsed( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], + }), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const licensesGetParamSchema = z.object({ license: z.coerce.string() }) - - router.get("licensesGet", "/licenses/:license", async (ctx, next) => { - const input = { - params: parseRequestInput(licensesGetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.licensesGet(input, ctx) + ["401", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) - ctx.body = responseValidationFactory( - [ - ["200", s_license], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) + router.get( + "appsListAccountsForPlan", + "/marketplace_listing/plans/:planId/accounts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsListAccountsForPlanParamSchema, + ctx.params + ), + query: parseRequestInput(appsListAccountsForPlanQuerySchema, ctx.query), + body: undefined, + } - const markdownRenderBodySchema = z.object({ - text: z.coerce.string(), - mode: z.enum(["markdown", "gfm"]).optional(), - context: z.coerce.string().optional(), - }) + const { status, body } = await implementation.appsListAccountsForPlan( + input, + ctx + ) - router.post("markdownRender", "/markdown", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput(markdownRenderBodySchema, ctx.body), + ctx.body = appsListAccountsForPlanResponseValidator(status, body) + ctx.status = status + return next() } + ) - const { status, body } = await implementation.markdownRender(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", z.coerce.string()], - ["304", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() + const appsGetSubscriptionPlanForAccountStubbedParamSchema = z.object({ + account_id: z.coerce.number(), }) - const markdownRenderRawBodySchema = z.coerce.string().optional() - - router.post("markdownRenderRaw", "/markdown/raw", async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput(markdownRenderRawBodySchema, ctx.body), - } - - const { status, body } = await implementation.markdownRenderRaw(input, ctx) - - ctx.body = responseValidationFactory( + const appsGetSubscriptionPlanForAccountStubbedResponseValidator = + responseValidationFactory( [ - ["200", z.coerce.string()], - ["304", z.void()], + ["200", s_marketplace_purchase], + ["401", s_basic_error], + ["404", z.void()], ], undefined - )(status, body) - ctx.status = status - return next() - }) - - const appsGetSubscriptionPlanForAccountParamSchema = z.object({ - account_id: z.coerce.number(), - }) + ) router.get( - "appsGetSubscriptionPlanForAccount", - "/marketplace_listing/accounts/:accountId", + "appsGetSubscriptionPlanForAccountStubbed", + "/marketplace_listing/stubbed/accounts/:accountId", async (ctx, next) => { const input = { params: parseRequestInput( - appsGetSubscriptionPlanForAccountParamSchema, + appsGetSubscriptionPlanForAccountStubbedParamSchema, ctx.params ), query: undefined, @@ -16728,144 +17105,103 @@ export function bootstrap( } const { status, body } = - await implementation.appsGetSubscriptionPlanForAccount(input, ctx) + await implementation.appsGetSubscriptionPlanForAccountStubbed( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - ["200", s_marketplace_purchase], - ["401", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsGetSubscriptionPlanForAccountStubbedResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const appsListPlansQuerySchema = z.object({ + const appsListPlansStubbedQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) + const appsListPlansStubbedResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + ), + ], + ["401", s_basic_error], + ], + undefined + ) + router.get( - "appsListPlans", - "/marketplace_listing/plans", + "appsListPlansStubbed", + "/marketplace_listing/stubbed/plans", async (ctx, next) => { const input = { params: undefined, - query: parseRequestInput(appsListPlansQuerySchema, ctx.query), + query: parseRequestInput(appsListPlansStubbedQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.appsListPlans(input, ctx) + const { status, body } = await implementation.appsListPlansStubbed( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - ), - ], - ["401", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsListPlansStubbedResponseValidator(status, body) ctx.status = status return next() } ) - const appsListAccountsForPlanParamSchema = z.object({ + const appsListAccountsForPlanStubbedParamSchema = z.object({ plan_id: z.coerce.number(), }) - const appsListAccountsForPlanQuerySchema = z.object({ + const appsListAccountsForPlanStubbedQuerySchema = z.object({ sort: z.enum(["created", "updated"]).optional(), direction: z.enum(["asc", "desc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "appsListAccountsForPlan", - "/marketplace_listing/plans/:planId/accounts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsListAccountsForPlanParamSchema, - ctx.params - ), - query: parseRequestInput(appsListAccountsForPlanQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.appsListAccountsForPlan( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const appsListAccountsForPlanStubbedResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ - is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), - unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), + "200", + z.array( + z.object({ + url: z.coerce.string(), + type: z.coerce.string(), + id: z.coerce.number(), + login: z.coerce.string(), + organization_billing_email: z.coerce.string().optional(), + email: z.coerce.string().optional(), + marketplace_pending_change: z + .object({ is_installed: z.coerce.boolean().optional(), + effective_date: z.coerce.string().optional(), unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), + id: z.coerce.number().optional(), plan: z .object({ url: z.coerce.string(), @@ -16883,118 +17219,41 @@ export function bootstrap( bullets: z.array(z.coerce.string()), }) .optional(), - }), - }) - ), - ], - ["401", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsGetSubscriptionPlanForAccountStubbedParamSchema = z.object({ - account_id: z.coerce.number(), - }) - - router.get( - "appsGetSubscriptionPlanForAccountStubbed", - "/marketplace_listing/stubbed/accounts/:accountId", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsGetSubscriptionPlanForAccountStubbedParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.appsGetSubscriptionPlanForAccountStubbed( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["200", s_marketplace_purchase], - ["401", s_basic_error], - ["404", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsListPlansStubbedQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "appsListPlansStubbed", - "/marketplace_listing/stubbed/plans", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(appsListPlansStubbedQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.appsListPlansStubbed( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - ), - ], - ["401", s_basic_error], + }) + .optional(), + marketplace_purchase: z.object({ + billing_cycle: z.coerce.string().optional(), + next_billing_date: z.coerce.string().optional(), + is_installed: z.coerce.boolean().optional(), + unit_count: z.coerce.number().optional(), + on_free_trial: z.coerce.boolean().optional(), + free_trial_ends_on: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + plan: z + .object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }) + .optional(), + }), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsListAccountsForPlanStubbedParamSchema = z.object({ - plan_id: z.coerce.number(), - }) - - const appsListAccountsForPlanStubbedQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ["401", s_basic_error], + ], + undefined + ) router.get( "appsListAccountsForPlanStubbed", @@ -17015,81 +17274,20 @@ export function bootstrap( const { status, body } = await implementation.appsListAccountsForPlanStubbed(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - type: z.coerce.string(), - id: z.coerce.number(), - login: z.coerce.string(), - organization_billing_email: z.coerce.string().optional(), - email: z.coerce.string().optional(), - marketplace_pending_change: z - .object({ - is_installed: z.coerce.boolean().optional(), - effective_date: z.coerce.string().optional(), - unit_count: z.coerce.number().optional(), - id: z.coerce.number().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }) - .optional(), - marketplace_purchase: z.object({ - billing_cycle: z.coerce.string().optional(), - next_billing_date: z.coerce.string().optional(), - is_installed: z.coerce.boolean().optional(), - unit_count: z.coerce.number().optional(), - on_free_trial: z.coerce.boolean().optional(), - free_trial_ends_on: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - plan: z - .object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }) - .optional(), - }), - }) - ), - ], - ["401", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsListAccountsForPlanStubbedResponseValidator(status, body) ctx.status = status return next() } ) + const metaGetResponseValidator = responseValidationFactory( + [ + ["200", s_api_overview], + ["304", z.void()], + ], + undefined + ) + router.get("metaGet", "/meta", async (ctx, next) => { const input = { params: undefined, @@ -17099,13 +17297,7 @@ export function bootstrap( const { status, body } = await implementation.metaGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_api_overview], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = metaGetResponseValidator(status, body) ctx.status = status return next() }) @@ -17120,76 +17312,155 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "activityListPublicEventsForRepoNetwork", - "/networks/:owner/:repo/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListPublicEventsForRepoNetworkParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListPublicEventsForRepoNetworkQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListPublicEventsForRepoNetwork(input, ctx) - - ctx.body = responseValidationFactory( + const activityListPublicEventsForRepoNetworkResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17212,21 +17483,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17248,10 +17532,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17274,19 +17575,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -17309,605 +17609,489 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["301", s_basic_error], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) + ["301", s_basic_error], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "activityListPublicEventsForRepoNetwork", + "/networks/:owner/:repo/events", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListPublicEventsForRepoNetworkParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListPublicEventsForRepoNetworkQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListPublicEventsForRepoNetwork(input, ctx) + + ctx.body = activityListPublicEventsForRepoNetworkResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -17922,6 +18106,199 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const activityListNotificationsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "activityListNotificationsForAuthenticatedUser", "/notifications", @@ -17941,197 +18318,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - subject: z.object({ - title: z.coerce.string(), - url: z.coerce.string(), - latest_comment_url: z.coerce.string(), - type: z.coerce.string(), - }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), - url: z.coerce.string(), - subscription_url: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = activityListNotificationsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18144,6 +18334,18 @@ export function bootstrap( }) .optional() + const activityMarkNotificationsAsReadResponseValidator = + responseValidationFactory( + [ + ["202", z.object({ message: z.coerce.string().optional() })], + ["205", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.put( "activityMarkNotificationsAsRead", "/notifications", @@ -18160,16 +18362,7 @@ export function bootstrap( const { status, body } = await implementation.activityMarkNotificationsAsRead(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({ message: z.coerce.string().optional() })], - ["205", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityMarkNotificationsAsReadResponseValidator(status, body) ctx.status = status return next() } @@ -18179,6 +18372,16 @@ export function bootstrap( thread_id: z.coerce.number(), }) + const activityGetThreadResponseValidator = responseValidationFactory( + [ + ["200", s_thread], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "activityGetThread", "/notifications/threads/:threadId", @@ -18194,15 +18397,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_thread], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityGetThreadResponseValidator(status, body) ctx.status = status return next() } @@ -18212,6 +18407,15 @@ export function bootstrap( thread_id: z.coerce.number(), }) + const activityMarkThreadAsReadResponseValidator = responseValidationFactory( + [ + ["205", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ], + undefined + ) + router.patch( "activityMarkThreadAsRead", "/notifications/threads/:threadId", @@ -18230,14 +18434,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["205", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityMarkThreadAsReadResponseValidator(status, body) ctx.status = status return next() } @@ -18247,6 +18444,17 @@ export function bootstrap( { thread_id: z.coerce.number() } ) + const activityGetThreadSubscriptionForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_thread_subscription], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "activityGetThreadSubscriptionForAuthenticatedUser", "/notifications/threads/:threadId/subscription", @@ -18266,15 +18474,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_thread_subscription], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + activityGetThreadSubscriptionForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18288,6 +18492,17 @@ export function bootstrap( .object({ ignored: z.coerce.boolean().optional() }) .optional() + const activitySetThreadSubscriptionResponseValidator = + responseValidationFactory( + [ + ["200", s_thread_subscription], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.put( "activitySetThreadSubscription", "/notifications/threads/:threadId/subscription", @@ -18307,15 +18522,7 @@ export function bootstrap( const { status, body } = await implementation.activitySetThreadSubscription(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_thread_subscription], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activitySetThreadSubscriptionResponseValidator(status, body) ctx.status = status return next() } @@ -18325,6 +18532,17 @@ export function bootstrap( thread_id: z.coerce.number(), }) + const activityDeleteThreadSubscriptionResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.delete( "activityDeleteThreadSubscription", "/notifications/threads/:threadId/subscription", @@ -18341,15 +18559,7 @@ export function bootstrap( const { status, body } = await implementation.activityDeleteThreadSubscription(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityDeleteThreadSubscriptionResponseValidator(status, body) ctx.status = status return next() } @@ -18359,6 +18569,11 @@ export function bootstrap( s: z.coerce.string().optional(), }) + const metaGetOctocatResponseValidator = responseValidationFactory( + [["200", z.coerce.string()]], + undefined + ) + router.get("metaGetOctocat", "/octocat", async (ctx, next) => { const input = { params: undefined, @@ -18368,10 +18583,7 @@ export function bootstrap( const { status, body } = await implementation.metaGetOctocat(input, ctx) - ctx.body = responseValidationFactory( - [["200", z.coerce.string()]], - undefined - )(status, body) + ctx.body = metaGetOctocatResponseValidator(status, body) ctx.status = status return next() }) @@ -18381,6 +18593,32 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const orgsListResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ], + undefined + ) + router.get("orgsList", "/organizations", async (ctx, next) => { const input = { params: undefined, @@ -18390,37 +18628,21 @@ export function bootstrap( const { status, body } = await implementation.orgsList(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = orgsListResponseValidator(status, body) ctx.status = status return next() }) const orgsGetParamSchema = z.object({ org: z.coerce.string() }) + const orgsGetResponseValidator = responseValidationFactory( + [ + ["200", s_organization_full], + ["404", s_basic_error], + ], + undefined + ) + router.get("orgsGet", "/orgs/:org", async (ctx, next) => { const input = { params: parseRequestInput(orgsGetParamSchema, ctx.params), @@ -18430,13 +18652,7 @@ export function bootstrap( const { status, body } = await implementation.orgsGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_organization_full], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsGetResponseValidator(status, body) ctx.status = status return next() }) @@ -18495,6 +18711,15 @@ export function bootstrap( }) .optional() + const orgsUpdateResponseValidator = responseValidationFactory( + [ + ["200", s_organization_full], + ["409", s_basic_error], + ["422", z.union([s_validation_error, s_validation_error_simple])], + ], + undefined + ) + router.patch("orgsUpdate", "/orgs/:org", async (ctx, next) => { const input = { params: parseRequestInput(orgsUpdateParamSchema, ctx.params), @@ -18504,14 +18729,7 @@ export function bootstrap( const { status, body } = await implementation.orgsUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_organization_full], - ["409", s_basic_error], - ["422", z.union([s_validation_error, s_validation_error_simple])], - ], - undefined - )(status, body) + ctx.body = orgsUpdateResponseValidator(status, body) ctx.status = status return next() }) @@ -18520,6 +18738,12 @@ export function bootstrap( org: z.coerce.string(), }) + const actionsGetActionsCacheUsageForOrgResponseValidator = + responseValidationFactory( + [["200", s_actions_cache_usage_org_enterprise]], + undefined + ) + router.get( "actionsGetActionsCacheUsageForOrg", "/orgs/:org/actions/cache/usage", @@ -18536,10 +18760,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetActionsCacheUsageForOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_actions_cache_usage_org_enterprise]], - undefined - )(status, body) + ctx.body = actionsGetActionsCacheUsageForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18554,6 +18778,26 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsGetActionsCacheUsageByRepoForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repository_cache_usages: z.array( + z.object({ + full_name: z.coerce.string(), + active_caches_size_in_bytes: z.coerce.number(), + active_caches_count: z.coerce.number(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsGetActionsCacheUsageByRepoForOrg", "/orgs/:org/actions/cache/usage-by-repository", @@ -18573,24 +18817,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetActionsCacheUsageByRepoForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repository_cache_usages: z.array( - z.object({ - full_name: z.coerce.string(), - active_caches_size_in_bytes: z.coerce.number(), - active_caches_count: z.coerce.number(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsGetActionsCacheUsageByRepoForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18600,6 +18830,9 @@ export function bootstrap( org: z.coerce.string(), }) + const oidcGetOidcCustomSubTemplateForOrgResponseValidator = + responseValidationFactory([["200", s_oidc_custom_sub]], undefined) + router.get( "oidcGetOidcCustomSubTemplateForOrg", "/orgs/:org/actions/oidc/customization/sub", @@ -18616,10 +18849,10 @@ export function bootstrap( const { status, body } = await implementation.oidcGetOidcCustomSubTemplateForOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_oidc_custom_sub]], - undefined - )(status, body) + ctx.body = oidcGetOidcCustomSubTemplateForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18631,6 +18864,16 @@ export function bootstrap( const oidcUpdateOidcCustomSubTemplateForOrgBodySchema = s_oidc_custom_sub + const oidcUpdateOidcCustomSubTemplateForOrgResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.put( "oidcUpdateOidcCustomSubTemplateForOrg", "/orgs/:org/actions/oidc/customization/sub", @@ -18650,14 +18893,10 @@ export function bootstrap( const { status, body } = await implementation.oidcUpdateOidcCustomSubTemplateForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = oidcUpdateOidcCustomSubTemplateForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18667,6 +18906,12 @@ export function bootstrap( org: z.coerce.string(), }) + const actionsGetGithubActionsPermissionsOrganizationResponseValidator = + responseValidationFactory( + [["200", s_actions_organization_permissions]], + undefined + ) + router.get( "actionsGetGithubActionsPermissionsOrganization", "/orgs/:org/actions/permissions", @@ -18686,10 +18931,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_organization_permissions]], - undefined - )(status, body) + ctx.body = + actionsGetGithubActionsPermissionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18704,6 +18950,9 @@ export function bootstrap( allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), }) + const actionsSetGithubActionsPermissionsOrganizationResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetGithubActionsPermissionsOrganization", "/orgs/:org/actions/permissions", @@ -18726,10 +18975,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + actionsSetGithubActionsPermissionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -18744,84 +18994,29 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "actionsListSelectedRepositoriesEnabledGithubActionsOrganization", - "/orgs/:org/actions/permissions/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListSelectedRepositoriesEnabledGithubActionsOrganizationParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListSelectedRepositoriesEnabledGithubActionsOrganizationQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsListSelectedRepositoriesEnabledGithubActionsOrganization( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const actionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -18843,264 +19038,329 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - }), - ], + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParamSchema = - z.object({ org: z.coerce.string() }) - - const actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationBodySchema = - z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + ], + undefined + ) - router.put( - "actionsSetSelectedRepositoriesEnabledGithubActionsOrganization", + router.get( + "actionsListSelectedRepositoriesEnabledGithubActionsOrganization", "/orgs/:org/actions/permissions/repositories", async (ctx, next) => { const input = { params: parseRequestInput( - actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParamSchema, + actionsListSelectedRepositoriesEnabledGithubActionsOrganizationParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput( - actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationBodySchema, + query: parseRequestInput( + actionsListSelectedRepositoriesEnabledGithubActionsOrganizationQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListSelectedRepositoriesEnabledGithubActionsOrganization( + input, + ctx + ) + + ctx.body = + actionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParamSchema = + z.object({ org: z.coerce.string() }) + + const actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationBodySchema = + z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + + const actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + + router.put( + "actionsSetSelectedRepositoriesEnabledGithubActionsOrganization", + "/orgs/:org/actions/permissions/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationBodySchema, ctx.body ), } @@ -19111,10 +19371,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + actionsSetSelectedRepositoriesEnabledGithubActionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -19123,6 +19384,9 @@ export function bootstrap( const actionsEnableSelectedRepositoryGithubActionsOrganizationParamSchema = z.object({ org: z.coerce.string(), repository_id: z.coerce.number() }) + const actionsEnableSelectedRepositoryGithubActionsOrganizationResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsEnableSelectedRepositoryGithubActionsOrganization", "/orgs/:org/actions/permissions/repositories/:repositoryId", @@ -19142,10 +19406,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + actionsEnableSelectedRepositoryGithubActionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -19154,6 +19419,9 @@ export function bootstrap( const actionsDisableSelectedRepositoryGithubActionsOrganizationParamSchema = z.object({ org: z.coerce.string(), repository_id: z.coerce.number() }) + const actionsDisableSelectedRepositoryGithubActionsOrganizationResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDisableSelectedRepositoryGithubActionsOrganization", "/orgs/:org/actions/permissions/repositories/:repositoryId", @@ -19173,10 +19441,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + actionsDisableSelectedRepositoryGithubActionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -19186,6 +19455,9 @@ export function bootstrap( org: z.coerce.string(), }) + const actionsGetAllowedActionsOrganizationResponseValidator = + responseValidationFactory([["200", s_selected_actions]], undefined) + router.get( "actionsGetAllowedActionsOrganization", "/orgs/:org/actions/permissions/selected-actions", @@ -19202,10 +19474,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetAllowedActionsOrganization(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_selected_actions]], - undefined - )(status, body) + ctx.body = actionsGetAllowedActionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -19217,6 +19489,9 @@ export function bootstrap( const actionsSetAllowedActionsOrganizationBodySchema = s_selected_actions + const actionsSetAllowedActionsOrganizationResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetAllowedActionsOrganization", "/orgs/:org/actions/permissions/selected-actions", @@ -19236,7 +19511,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetAllowedActionsOrganization(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetAllowedActionsOrganizationResponseValidator( status, body ) @@ -19248,6 +19523,12 @@ export function bootstrap( const actionsGetGithubActionsDefaultWorkflowPermissionsOrganizationParamSchema = z.object({ org: z.coerce.string() }) + const actionsGetGithubActionsDefaultWorkflowPermissionsOrganizationResponseValidator = + responseValidationFactory( + [["200", s_actions_get_default_workflow_permissions]], + undefined + ) + router.get( "actionsGetGithubActionsDefaultWorkflowPermissionsOrganization", "/orgs/:org/actions/permissions/workflow", @@ -19267,10 +19548,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_get_default_workflow_permissions]], - undefined - )(status, body) + ctx.body = + actionsGetGithubActionsDefaultWorkflowPermissionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -19282,6 +19564,15 @@ export function bootstrap( const actionsSetGithubActionsDefaultWorkflowPermissionsOrganizationBodySchema = s_actions_set_default_workflow_permissions + const actionsSetGithubActionsDefaultWorkflowPermissionsOrganizationResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.put( "actionsSetGithubActionsDefaultWorkflowPermissionsOrganization", "/orgs/:org/actions/permissions/workflow", @@ -19304,13 +19595,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = + actionsSetGithubActionsDefaultWorkflowPermissionsOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -19325,6 +19614,194 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListRequiredWorkflowsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + required_workflows: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + path: z.coerce.string(), + scope: z.enum(["all", "selected"]), + ref: z.coerce.string(), + state: z.enum(["active", "deleted"]), + selected_repositories_url: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListRequiredWorkflows", "/orgs/:org/actions/required_workflows", @@ -19344,192 +19821,7 @@ export function bootstrap( const { status, body } = await implementation.actionsListRequiredWorkflows(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - required_workflows: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - path: z.coerce.string(), - scope: z.enum(["all", "selected"]), - ref: z.coerce.string(), - state: z.enum(["active", "deleted"]), - selected_repositories_url: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListRequiredWorkflowsResponseValidator(status, body) ctx.status = status return next() } @@ -19546,6 +19838,15 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()).optional(), }) + const actionsCreateRequiredWorkflowResponseValidator = + responseValidationFactory( + [ + ["201", s_required_workflow], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "actionsCreateRequiredWorkflow", "/orgs/:org/actions/required_workflows", @@ -19565,13 +19866,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRequiredWorkflow(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_required_workflow], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = actionsCreateRequiredWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -19582,6 +19877,11 @@ export function bootstrap( required_workflow_id: z.coerce.number(), }) + const actionsGetRequiredWorkflowResponseValidator = responseValidationFactory( + [["200", s_required_workflow]], + undefined + ) + router.get( "actionsGetRequiredWorkflow", "/orgs/:org/actions/required_workflows/:requiredWorkflowId", @@ -19600,10 +19900,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_required_workflow]], - undefined - )(status, body) + ctx.body = actionsGetRequiredWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -19621,6 +19918,15 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()).optional(), }) + const actionsUpdateRequiredWorkflowResponseValidator = + responseValidationFactory( + [ + ["200", s_required_workflow], + ["422", s_validation_error_simple], + ], + undefined + ) + router.patch( "actionsUpdateRequiredWorkflow", "/orgs/:org/actions/required_workflows/:requiredWorkflowId", @@ -19640,13 +19946,7 @@ export function bootstrap( const { status, body } = await implementation.actionsUpdateRequiredWorkflow(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_required_workflow], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = actionsUpdateRequiredWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -19657,6 +19957,9 @@ export function bootstrap( required_workflow_id: z.coerce.number(), }) + const actionsDeleteRequiredWorkflowResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDeleteRequiredWorkflow", "/orgs/:org/actions/required_workflows/:requiredWorkflowId", @@ -19673,10 +19976,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteRequiredWorkflow(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteRequiredWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -19687,85 +19987,33 @@ export function bootstrap( required_workflow_id: z.coerce.number(), }) - router.get( - "actionsListSelectedRepositoriesRequiredWorkflow", - "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListSelectedRepositoriesRequiredWorkflowParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsListSelectedRepositoriesRequiredWorkflow( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const actionsListSelectedRepositoriesRequiredWorkflowResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), avatar_url: z.coerce.string(), gravatar_id: z.coerce.string(), @@ -19783,256 +20031,318 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - }), - ], - ["404", z.void()], + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) + ["404", z.void()], + ], + undefined + ) - const actionsSetSelectedReposToRequiredWorkflowParamSchema = z.object({ - org: z.coerce.string(), - required_workflow_id: z.coerce.number(), + router.get( + "actionsListSelectedRepositoriesRequiredWorkflow", + "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListSelectedRepositoriesRequiredWorkflowParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsListSelectedRepositoriesRequiredWorkflow( + input, + ctx + ) + + ctx.body = + actionsListSelectedRepositoriesRequiredWorkflowResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const actionsSetSelectedReposToRequiredWorkflowParamSchema = z.object({ + org: z.coerce.string(), + required_workflow_id: z.coerce.number(), }) const actionsSetSelectedReposToRequiredWorkflowBodySchema = z.object({ selected_repository_ids: z.array(z.coerce.number()), }) + const actionsSetSelectedReposToRequiredWorkflowResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetSelectedReposToRequiredWorkflow", "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories", @@ -20055,7 +20365,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetSelectedReposToRequiredWorkflowResponseValidator( status, body ) @@ -20070,6 +20380,16 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsAddSelectedRepoToRequiredWorkflowResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ["422", z.void()], + ], + undefined + ) + router.put( "actionsAddSelectedRepoToRequiredWorkflow", "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories/:repositoryId", @@ -20089,14 +20409,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsAddSelectedRepoToRequiredWorkflowResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20108,6 +20424,16 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsRemoveSelectedRepoFromRequiredWorkflowResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ["422", z.void()], + ], + undefined + ) + router.delete( "actionsRemoveSelectedRepoFromRequiredWorkflow", "/orgs/:org/actions/required_workflows/:requiredWorkflowId/repositories/:repositoryId", @@ -20127,14 +20453,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsRemoveSelectedRepoFromRequiredWorkflowResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20150,6 +20472,37 @@ export function bootstrap( visible_to_repository: z.coerce.string().optional(), }) + const actionsListSelfHostedRunnerGroupsForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runner_groups: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + visibility: z.coerce.string(), + default: z.coerce.boolean(), + selected_repositories_url: z.coerce.string().optional(), + runners_url: z.coerce.string(), + inherited: z.coerce.boolean(), + inherited_allows_public_repositories: z.coerce + .boolean() + .optional(), + allows_public_repositories: z.coerce.boolean(), + workflow_restrictions_read_only: z.coerce.boolean().optional(), + restricted_to_workflows: z.coerce.boolean().optional(), + selected_workflows: z.array(z.coerce.string()).optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListSelfHostedRunnerGroupsForOrg", "/orgs/:org/actions/runner-groups", @@ -20169,37 +20522,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnerGroupsForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - runner_groups: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - visibility: z.coerce.string(), - default: z.coerce.boolean(), - selected_repositories_url: z.coerce.string().optional(), - runners_url: z.coerce.string(), - inherited: z.coerce.boolean(), - inherited_allows_public_repositories: z.coerce - .boolean() - .optional(), - allows_public_repositories: z.coerce.boolean(), - workflow_restrictions_read_only: z.coerce - .boolean() - .optional(), - restricted_to_workflows: z.coerce.boolean().optional(), - selected_workflows: z.array(z.coerce.string()).optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListSelfHostedRunnerGroupsForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20219,6 +20545,9 @@ export function bootstrap( selected_workflows: z.array(z.coerce.string()).optional(), }) + const actionsCreateSelfHostedRunnerGroupForOrgResponseValidator = + responseValidationFactory([["201", s_runner_groups_org]], undefined) + router.post( "actionsCreateSelfHostedRunnerGroupForOrg", "/orgs/:org/actions/runner-groups", @@ -20241,10 +20570,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_runner_groups_org]], - undefined - )(status, body) + ctx.body = actionsCreateSelfHostedRunnerGroupForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20255,6 +20584,9 @@ export function bootstrap( runner_group_id: z.coerce.number(), }) + const actionsGetSelfHostedRunnerGroupForOrgResponseValidator = + responseValidationFactory([["200", s_runner_groups_org]], undefined) + router.get( "actionsGetSelfHostedRunnerGroupForOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId", @@ -20271,10 +20603,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerGroupForOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_runner_groups_org]], - undefined - )(status, body) + ctx.body = actionsGetSelfHostedRunnerGroupForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20293,6 +20625,9 @@ export function bootstrap( selected_workflows: z.array(z.coerce.string()).optional(), }) + const actionsUpdateSelfHostedRunnerGroupForOrgResponseValidator = + responseValidationFactory([["200", s_runner_groups_org]], undefined) + router.patch( "actionsUpdateSelfHostedRunnerGroupForOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId", @@ -20315,10 +20650,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_runner_groups_org]], - undefined - )(status, body) + ctx.body = actionsUpdateSelfHostedRunnerGroupForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20329,6 +20664,9 @@ export function bootstrap( runner_group_id: z.coerce.number(), }) + const actionsDeleteSelfHostedRunnerGroupFromOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDeleteSelfHostedRunnerGroupFromOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId", @@ -20348,7 +20686,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsDeleteSelfHostedRunnerGroupFromOrgResponseValidator( status, body ) @@ -20368,6 +20706,183 @@ export function bootstrap( } ) + const actionsListRepoAccessToSelfHostedRunnerGroupInOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListRepoAccessToSelfHostedRunnerGroupInOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/repositories", @@ -20390,181 +20905,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = + actionsListRepoAccessToSelfHostedRunnerGroupInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20579,6 +20924,9 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()), }) + const actionsSetRepoAccessToSelfHostedRunnerGroupInOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetRepoAccessToSelfHostedRunnerGroupInOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/repositories", @@ -20601,10 +20949,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + actionsSetRepoAccessToSelfHostedRunnerGroupInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20617,6 +20966,9 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/repositories/:repositoryId", @@ -20636,10 +20988,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20655,6 +21008,35 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListSelfHostedRunnersInGroupForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListSelfHostedRunnersInGroupForOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/runners", @@ -20677,33 +21059,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListSelfHostedRunnersInGroupForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20718,6 +21077,9 @@ export function bootstrap( runners: z.array(z.coerce.number()), }) + const actionsSetSelfHostedRunnersInGroupForOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetSelfHostedRunnersInGroupForOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/runners", @@ -20740,7 +21102,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetSelfHostedRunnersInGroupForOrgResponseValidator( status, body ) @@ -20755,6 +21117,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsAddSelfHostedRunnerToGroupForOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsAddSelfHostedRunnerToGroupForOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/runners/:runnerId", @@ -20771,7 +21136,7 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelfHostedRunnerToGroupForOrg(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsAddSelfHostedRunnerToGroupForOrgResponseValidator( status, body ) @@ -20786,6 +21151,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsRemoveSelfHostedRunnerFromGroupForOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsRemoveSelfHostedRunnerFromGroupForOrg", "/orgs/:org/actions/runner-groups/:runnerGroupId/runners/:runnerId", @@ -20805,7 +21173,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsRemoveSelfHostedRunnerFromGroupForOrgResponseValidator( status, body ) @@ -20823,52 +21191,58 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "actionsListSelfHostedRunnersForOrg", - "/orgs/:org/actions/runners", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListSelfHostedRunnersForOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListSelfHostedRunnersForOrgQuerySchema, - ctx.query - ), - body: undefined, + const actionsListSelfHostedRunnersForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }), + ], + ], + undefined + ) + + router.get( + "actionsListSelfHostedRunnersForOrg", + "/orgs/:org/actions/runners", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListSelfHostedRunnersForOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListSelfHostedRunnersForOrgQuerySchema, + ctx.query + ), + body: undefined, } const { status, body } = await implementation.actionsListSelfHostedRunnersForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListSelfHostedRunnersForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20878,6 +21252,26 @@ export function bootstrap( org: z.coerce.string(), }) + const actionsListRunnerApplicationsForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "actionsListRunnerApplicationsForOrg", "/orgs/:org/actions/runners/downloads", @@ -20894,24 +21288,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListRunnerApplicationsForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - os: z.coerce.string(), - architecture: z.coerce.string(), - download_url: z.coerce.string(), - filename: z.coerce.string(), - temp_download_token: z.coerce.string().optional(), - sha256_checksum: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = actionsListRunnerApplicationsForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20921,6 +21301,9 @@ export function bootstrap( org: z.coerce.string(), }) + const actionsCreateRegistrationTokenForOrgResponseValidator = + responseValidationFactory([["201", s_authentication_token]], undefined) + router.post( "actionsCreateRegistrationTokenForOrg", "/orgs/:org/actions/runners/registration-token", @@ -20937,10 +21320,10 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRegistrationTokenForOrg(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_authentication_token]], - undefined - )(status, body) + ctx.body = actionsCreateRegistrationTokenForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -20950,6 +21333,9 @@ export function bootstrap( org: z.coerce.string(), }) + const actionsCreateRemoveTokenForOrgResponseValidator = + responseValidationFactory([["201", s_authentication_token]], undefined) + router.post( "actionsCreateRemoveTokenForOrg", "/orgs/:org/actions/runners/remove-token", @@ -20966,10 +21352,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRemoveTokenForOrg(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_authentication_token]], - undefined - )(status, body) + ctx.body = actionsCreateRemoveTokenForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -20980,6 +21363,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsGetSelfHostedRunnerForOrgResponseValidator = + responseValidationFactory([["200", s_runner]], undefined) + router.get( "actionsGetSelfHostedRunnerForOrg", "/orgs/:org/actions/runners/:runnerId", @@ -20996,10 +21382,7 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerForOrg(input, ctx) - ctx.body = responseValidationFactory([["200", s_runner]], undefined)( - status, - body - ) + ctx.body = actionsGetSelfHostedRunnerForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -21010,6 +21393,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsDeleteSelfHostedRunnerFromOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDeleteSelfHostedRunnerFromOrg", "/orgs/:org/actions/runners/:runnerId", @@ -21026,7 +21412,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteSelfHostedRunnerFromOrg(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsDeleteSelfHostedRunnerFromOrgResponseValidator( status, body ) @@ -21040,6 +21426,27 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsListLabelsForSelfHostedRunnerForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "actionsListLabelsForSelfHostedRunnerForOrg", "/orgs/:org/actions/runners/:runnerId/labels", @@ -21059,25 +21466,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsListLabelsForSelfHostedRunnerForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21092,6 +21484,28 @@ export function bootstrap( labels: z.array(z.coerce.string()), }) + const actionsAddCustomLabelsToSelfHostedRunnerForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "actionsAddCustomLabelsToSelfHostedRunnerForOrg", "/orgs/:org/actions/runners/:runnerId/labels", @@ -21114,26 +21528,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + actionsAddCustomLabelsToSelfHostedRunnerForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21148,6 +21547,28 @@ export function bootstrap( labels: z.array(z.coerce.string()), }) + const actionsSetCustomLabelsForSelfHostedRunnerForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "actionsSetCustomLabelsForSelfHostedRunnerForOrg", "/orgs/:org/actions/runners/:runnerId/labels", @@ -21170,26 +21591,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + actionsSetCustomLabelsForSelfHostedRunnerForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21198,6 +21604,27 @@ export function bootstrap( const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgParamSchema = z.object({ org: z.coerce.string(), runner_id: z.coerce.number() }) + const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg", "/orgs/:org/actions/runners/:runnerId/labels", @@ -21217,25 +21644,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21248,6 +21661,28 @@ export function bootstrap( name: z.coerce.string(), }) + const actionsRemoveCustomLabelFromSelfHostedRunnerForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.delete( "actionsRemoveCustomLabelFromSelfHostedRunnerForOrg", "/orgs/:org/actions/runners/:runnerId/labels/:name", @@ -21267,26 +21702,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + actionsRemoveCustomLabelFromSelfHostedRunnerForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21299,6 +21719,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListOrgSecretsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListOrgSecrets", "/orgs/:org/actions/secrets", @@ -21314,26 +21755,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListOrgSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -21341,6 +21763,11 @@ export function bootstrap( const actionsGetOrgPublicKeyParamSchema = z.object({ org: z.coerce.string() }) + const actionsGetOrgPublicKeyResponseValidator = responseValidationFactory( + [["200", s_actions_public_key]], + undefined + ) + router.get( "actionsGetOrgPublicKey", "/orgs/:org/actions/secrets/public-key", @@ -21359,10 +21786,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_public_key]], - undefined - )(status, body) + ctx.body = actionsGetOrgPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -21373,6 +21797,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const actionsGetOrgSecretResponseValidator = responseValidationFactory( + [["200", s_organization_actions_secret]], + undefined + ) + router.get( "actionsGetOrgSecret", "/orgs/:org/actions/secrets/:secretName", @@ -21388,10 +21817,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_organization_actions_secret]], - undefined - )(status, body) + ctx.body = actionsGetOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -21409,6 +21835,15 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()).optional(), }) + const actionsCreateOrUpdateOrgSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ], + undefined + ) + router.put( "actionsCreateOrUpdateOrgSecret", "/orgs/:org/actions/secrets/:secretName", @@ -21428,13 +21863,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsCreateOrUpdateOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -21445,6 +21874,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const actionsDeleteOrgSecretResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "actionsDeleteOrgSecret", "/orgs/:org/actions/secrets/:secretName", @@ -21463,10 +21897,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -21482,6 +21913,183 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const actionsListSelectedReposForOrgSecretResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListSelectedReposForOrgSecret", "/orgs/:org/actions/secrets/:secretName/repositories", @@ -21501,181 +22109,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelectedReposForOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListSelectedReposForOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21690,6 +22127,9 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()), }) + const actionsSetSelectedReposForOrgSecretResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetSelectedReposForOrgSecret", "/orgs/:org/actions/secrets/:secretName/repositories", @@ -21709,7 +22149,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetSelectedReposForOrgSecret(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetSelectedReposForOrgSecretResponseValidator( status, body ) @@ -21724,6 +22164,15 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsAddSelectedRepoToOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.put( "actionsAddSelectedRepoToOrgSecret", "/orgs/:org/actions/secrets/:secretName/repositories/:repositoryId", @@ -21740,13 +22189,10 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelectedRepoToOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsAddSelectedRepoToOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21758,6 +22204,15 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsRemoveSelectedRepoFromOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.delete( "actionsRemoveSelectedRepoFromOrgSecret", "/orgs/:org/actions/secrets/:secretName/repositories/:repositoryId", @@ -21774,13 +22229,10 @@ export function bootstrap( const { status, body } = await implementation.actionsRemoveSelectedRepoFromOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsRemoveSelectedRepoFromOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -21795,6 +22247,28 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListOrgVariablesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListOrgVariables", "/orgs/:org/actions/variables", @@ -21813,27 +22287,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListOrgVariablesResponseValidator(status, body) ctx.status = status return next() } @@ -21850,6 +22304,11 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()).optional(), }) + const actionsCreateOrgVariableResponseValidator = responseValidationFactory( + [["201", s_empty_object]], + undefined + ) + router.post( "actionsCreateOrgVariable", "/orgs/:org/actions/variables", @@ -21868,10 +22327,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_empty_object]], - undefined - )(status, body) + ctx.body = actionsCreateOrgVariableResponseValidator(status, body) ctx.status = status return next() } @@ -21882,6 +22338,11 @@ export function bootstrap( name: z.coerce.string(), }) + const actionsGetOrgVariableResponseValidator = responseValidationFactory( + [["200", s_organization_actions_variable]], + undefined + ) + router.get( "actionsGetOrgVariable", "/orgs/:org/actions/variables/:name", @@ -21897,10 +22358,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_organization_actions_variable]], - undefined - )(status, body) + ctx.body = actionsGetOrgVariableResponseValidator(status, body) ctx.status = status return next() } @@ -21918,6 +22376,11 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()).optional(), }) + const actionsUpdateOrgVariableResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.patch( "actionsUpdateOrgVariable", "/orgs/:org/actions/variables/:name", @@ -21936,10 +22399,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsUpdateOrgVariableResponseValidator(status, body) ctx.status = status return next() } @@ -21950,6 +22410,11 @@ export function bootstrap( name: z.coerce.string(), }) + const actionsDeleteOrgVariableResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "actionsDeleteOrgVariable", "/orgs/:org/actions/variables/:name", @@ -21968,10 +22433,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteOrgVariableResponseValidator(status, body) ctx.status = status return next() } @@ -21987,6 +22449,184 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const actionsListSelectedReposForOrgVariableResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ["409", z.void()], + ], + undefined + ) + router.get( "actionsListSelectedReposForOrgVariable", "/orgs/:org/actions/variables/:name/repositories", @@ -22006,182 +22646,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelectedReposForOrgVariable(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsListSelectedReposForOrgVariableResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -22196,8 +22664,17 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()), }) - router.put( - "actionsSetSelectedReposForOrgVariable", + const actionsSetSelectedReposForOrgVariableResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + + router.put( + "actionsSetSelectedReposForOrgVariable", "/orgs/:org/actions/variables/:name/repositories", async (ctx, next) => { const input = { @@ -22215,13 +22692,10 @@ export function bootstrap( const { status, body } = await implementation.actionsSetSelectedReposForOrgVariable(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsSetSelectedReposForOrgVariableResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -22233,6 +22707,15 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsAddSelectedRepoToOrgVariableResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.put( "actionsAddSelectedRepoToOrgVariable", "/orgs/:org/actions/variables/:name/repositories/:repositoryId", @@ -22249,13 +22732,10 @@ export function bootstrap( const { status, body } = await implementation.actionsAddSelectedRepoToOrgVariable(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsAddSelectedRepoToOrgVariableResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -22267,6 +22747,15 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const actionsRemoveSelectedRepoFromOrgVariableResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.delete( "actionsRemoveSelectedRepoFromOrgVariable", "/orgs/:org/actions/variables/:name/repositories/:repositoryId", @@ -22286,13 +22775,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsRemoveSelectedRepoFromOrgVariableResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -22305,6 +22791,40 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListBlockedUsersResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get("orgsListBlockedUsers", "/orgs/:org/blocks", async (ctx, next) => { const input = { params: parseRequestInput(orgsListBlockedUsersParamSchema, ctx.params), @@ -22317,39 +22837,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = orgsListBlockedUsersResponseValidator(status, body) ctx.status = status return next() }) @@ -22359,6 +22847,14 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsCheckBlockedUserResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get( "orgsCheckBlockedUser", "/orgs/:org/blocks/:username", @@ -22374,13 +22870,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsCheckBlockedUserResponseValidator(status, body) ctx.status = status return next() } @@ -22391,6 +22881,14 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsBlockUserResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.put( "orgsBlockUser", "/orgs/:org/blocks/:username", @@ -22403,13 +22901,7 @@ export function bootstrap( const { status, body } = await implementation.orgsBlockUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsBlockUserResponseValidator(status, body) ctx.status = status return next() } @@ -22420,6 +22912,11 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsUnblockUserResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "orgsUnblockUser", "/orgs/:org/blocks/:username", @@ -22432,10 +22929,7 @@ export function bootstrap( const { status, body } = await implementation.orgsUnblockUser(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = orgsUnblockUserResponseValidator(status, body) ctx.status = status return next() } @@ -22460,6 +22954,187 @@ export function bootstrap( .optional(), }) + const codeScanningListAlertsForOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + security_severity_level: z + .enum(["low", "medium", "high", "critical"]) + .optional(), + description: z.coerce.string().optional(), + full_description: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + help: z.coerce.string().optional(), + help_uri: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ), + ], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningListAlertsForOrg", "/orgs/:org/code-scanning/alerts", @@ -22479,27 +23154,35 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListAlertsForOrg(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = codeScanningListAlertsForOrgResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const codespacesListInOrganizationParamSchema = z.object({ + org: z.coerce.string(), + }) + + const codespacesListInOrganizationQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const codespacesListInOrganizationResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - dismissed_by: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -22522,59 +23205,28 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - severity: z - .enum(["none", "note", "warning", "error"]) - .optional(), - security_severity_level: z - .enum(["low", "medium", "high", "critical"]) - .optional(), - description: z.coerce.string().optional(), - full_description: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - help: z.coerce.string().optional(), - help_uri: z.coerce.string().optional(), - }), - tool: z.object({ + billable_owner: z.object({ name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), repository: z.object({ id: z.coerce.number(), @@ -22626,6 +23278,7 @@ export function bootstrap( git_commits_url: z.coerce.string(), git_refs_url: z.coerce.string(), git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), issue_comment_url: z.coerce.string(), issue_events_url: z.coerce.string(), issues_url: z.coerce.string(), @@ -22637,6 +23290,7 @@ export function bootstrap( notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), stargazers_url: z.coerce.string(), statuses_url: z.coerce.string(), subscribers_url: z.coerce.string(), @@ -22644,36 +23298,185 @@ export function bootstrap( tags_url: z.coerce.string(), teams_url: z.coerce.string(), trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), }) ), - ], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + }), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesListInOrganizationParamSchema = z.object({ - org: z.coerce.string(), - }) - - const codespacesListInOrganizationQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) router.get( "codespacesListInOrganization", @@ -22694,315 +23497,7 @@ export function bootstrap( const { status, body } = await implementation.codespacesListInOrganization(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) - .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce - .string() - .optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesListInOrganizationResponseValidator(status, body) ctx.status = status return next() } @@ -23022,6 +23517,19 @@ export function bootstrap( selected_usernames: z.array(z.coerce.string()).optional(), }) + const codespacesSetCodespacesBillingResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["400", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ["500", s_basic_error], + ], + undefined + ) + router.put( "codespacesSetCodespacesBilling", "/orgs/:org/codespaces/billing", @@ -23041,17 +23549,7 @@ export function bootstrap( const { status, body } = await implementation.codespacesSetCodespacesBilling(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["400", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesSetCodespacesBillingResponseValidator(status, body) ctx.status = status return next() } @@ -23066,6 +23564,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const codespacesListOrgSecretsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "codespacesListOrgSecrets", "/orgs/:org/codespaces/secrets", @@ -23087,26 +23606,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = codespacesListOrgSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -23116,6 +23616,11 @@ export function bootstrap( org: z.coerce.string(), }) + const codespacesGetOrgPublicKeyResponseValidator = responseValidationFactory( + [["200", s_codespaces_public_key]], + undefined + ) + router.get( "codespacesGetOrgPublicKey", "/orgs/:org/codespaces/secrets/public-key", @@ -23134,10 +23639,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_codespaces_public_key]], - undefined - )(status, body) + ctx.body = codespacesGetOrgPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -23148,6 +23650,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const codespacesGetOrgSecretResponseValidator = responseValidationFactory( + [["200", s_codespaces_org_secret]], + undefined + ) + router.get( "codespacesGetOrgSecret", "/orgs/:org/codespaces/secrets/:secretName", @@ -23166,10 +23673,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_codespaces_org_secret]], - undefined - )(status, body) + ctx.body = codespacesGetOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -23187,6 +23691,17 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()).optional(), }) + const codespacesCreateOrUpdateOrgSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "codespacesCreateOrUpdateOrgSecret", "/orgs/:org/codespaces/secrets/:secretName", @@ -23206,15 +23721,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateOrUpdateOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = codespacesCreateOrUpdateOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -23225,6 +23735,14 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const codespacesDeleteOrgSecretResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "codespacesDeleteOrgSecret", "/orgs/:org/codespaces/secrets/:secretName", @@ -23243,13 +23761,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesDeleteOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -23265,6 +23777,184 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const codespacesListSelectedReposForOrgSecretResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "codespacesListSelectedReposForOrgSecret", "/orgs/:org/codespaces/secrets/:secretName/repositories", @@ -23284,182 +23974,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesListSelectedReposForOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesListSelectedReposForOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -23474,6 +23992,16 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()), }) + const codespacesSetSelectedReposForOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["409", z.void()], + ], + undefined + ) + router.put( "codespacesSetSelectedReposForOrgSecret", "/orgs/:org/codespaces/secrets/:secretName/repositories", @@ -23493,14 +24021,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesSetSelectedReposForOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = codespacesSetSelectedReposForOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -23512,6 +24036,17 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const codespacesAddSelectedRepoToOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["409", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.put( "codespacesAddSelectedRepoToOrgSecret", "/orgs/:org/codespaces/secrets/:secretName/repositories/:repositoryId", @@ -23528,15 +24063,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesAddSelectedRepoToOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["409", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = codespacesAddSelectedRepoToOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -23548,6 +24078,17 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const codespacesRemoveSelectedRepoFromOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["409", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "codespacesRemoveSelectedRepoFromOrgSecret", "/orgs/:org/codespaces/secrets/:secretName/repositories/:repositoryId", @@ -23567,15 +24108,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["409", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = codespacesRemoveSelectedRepoFromOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -23600,6 +24136,191 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const dependabotListAlertsForOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ cwe_id: z.coerce.string(), name: z.coerce.string() }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }), + }) + ), + ], + ["304", z.void()], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.get( "dependabotListAlertsForOrg", "/orgs/:org/dependabot/alerts", @@ -23621,193 +24342,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }), - }) - ), - ], - ["304", z.void()], - ["400", s_scim_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = dependabotListAlertsForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -23822,6 +24357,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const dependabotListOrgSecretsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "dependabotListOrgSecrets", "/orgs/:org/dependabot/secrets", @@ -23843,26 +24399,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = dependabotListOrgSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -23872,6 +24409,11 @@ export function bootstrap( org: z.coerce.string(), }) + const dependabotGetOrgPublicKeyResponseValidator = responseValidationFactory( + [["200", s_dependabot_public_key]], + undefined + ) + router.get( "dependabotGetOrgPublicKey", "/orgs/:org/dependabot/secrets/public-key", @@ -23890,10 +24432,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_dependabot_public_key]], - undefined - )(status, body) + ctx.body = dependabotGetOrgPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -23904,6 +24443,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const dependabotGetOrgSecretResponseValidator = responseValidationFactory( + [["200", s_organization_dependabot_secret]], + undefined + ) + router.get( "dependabotGetOrgSecret", "/orgs/:org/dependabot/secrets/:secretName", @@ -23922,10 +24466,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_organization_dependabot_secret]], - undefined - )(status, body) + ctx.body = dependabotGetOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -23943,6 +24484,15 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.string()).optional(), }) + const dependabotCreateOrUpdateOrgSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ], + undefined + ) + router.put( "dependabotCreateOrUpdateOrgSecret", "/orgs/:org/dependabot/secrets/:secretName", @@ -23962,13 +24512,10 @@ export function bootstrap( const { status, body } = await implementation.dependabotCreateOrUpdateOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = dependabotCreateOrUpdateOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -23979,6 +24526,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const dependabotDeleteOrgSecretResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "dependabotDeleteOrgSecret", "/orgs/:org/dependabot/secrets/:secretName", @@ -23997,10 +24549,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = dependabotDeleteOrgSecretResponseValidator(status, body) ctx.status = status return next() } @@ -24016,200 +24565,206 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) - router.get( - "dependabotListSelectedReposForOrgSecret", - "/orgs/:org/dependabot/secrets/:secretName/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - dependabotListSelectedReposForOrgSecretParamSchema, - ctx.params - ), - query: parseRequestInput( - dependabotListSelectedReposForOrgSecretQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.dependabotListSelectedReposForOrgSecret(input, ctx) - - ctx.body = responseValidationFactory( + const dependabotListSelectedReposForOrgSecretResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "dependabotListSelectedReposForOrgSecret", + "/orgs/:org/dependabot/secrets/:secretName/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + dependabotListSelectedReposForOrgSecretParamSchema, + ctx.params + ), + query: parseRequestInput( + dependabotListSelectedReposForOrgSecretQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.dependabotListSelectedReposForOrgSecret(input, ctx) + + ctx.body = dependabotListSelectedReposForOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -24224,6 +24779,9 @@ export function bootstrap( selected_repository_ids: z.array(z.coerce.number()), }) + const dependabotSetSelectedReposForOrgSecretResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "dependabotSetSelectedReposForOrgSecret", "/orgs/:org/dependabot/secrets/:secretName/repositories", @@ -24243,7 +24801,7 @@ export function bootstrap( const { status, body } = await implementation.dependabotSetSelectedReposForOrgSecret(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = dependabotSetSelectedReposForOrgSecretResponseValidator( status, body ) @@ -24258,6 +24816,15 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const dependabotAddSelectedRepoToOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.put( "dependabotAddSelectedRepoToOrgSecret", "/orgs/:org/dependabot/secrets/:secretName/repositories/:repositoryId", @@ -24274,13 +24841,10 @@ export function bootstrap( const { status, body } = await implementation.dependabotAddSelectedRepoToOrgSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = dependabotAddSelectedRepoToOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -24292,6 +24856,15 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const dependabotRemoveSelectedRepoFromOrgSecretResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.delete( "dependabotRemoveSelectedRepoFromOrgSecret", "/orgs/:org/dependabot/secrets/:secretName/repositories/:repositoryId", @@ -24311,13 +24884,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = dependabotRemoveSelectedRepoFromOrgSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -24332,78 +24902,155 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "activityListPublicOrgEvents", - "/orgs/:org/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListPublicOrgEventsParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListPublicOrgEventsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.activityListPublicOrgEvents( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const activityListPublicOrgEventsResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -24426,21 +25073,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -24462,10 +25122,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -24488,19 +25165,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -24523,38 +25199,253 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -24576,548 +25467,216 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "activityListPublicOrgEvents", + "/orgs/:org/events", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListPublicOrgEventsParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListPublicOrgEventsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.activityListPublicOrgEvents( + input, + ctx + ) + + ctx.body = activityListPublicOrgEventsResponseValidator(status, body) ctx.status = status return next() } @@ -25132,6 +25691,54 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListFailedInvitationsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "orgsListFailedInvitations", "/orgs/:org/failed_invitations", @@ -25153,53 +25760,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsListFailedInvitationsResponseValidator(status, body) ctx.status = status return next() } @@ -25212,6 +25773,36 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListWebhooksResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + name: z.coerce.string(), + events: z.array(z.coerce.string()), + active: z.coerce.boolean(), + config: z.object({ + url: z.coerce.string().optional(), + insecure_ssl: z.coerce.string().optional(), + content_type: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get("orgsListWebhooks", "/orgs/:org/hooks", async (ctx, next) => { const input = { params: parseRequestInput(orgsListWebhooksParamSchema, ctx.params), @@ -25221,35 +25812,7 @@ export function bootstrap( const { status, body } = await implementation.orgsListWebhooks(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - name: z.coerce.string(), - events: z.array(z.coerce.string()), - active: z.coerce.boolean(), - config: z.object({ - url: z.coerce.string().optional(), - insecure_ssl: z.coerce.string().optional(), - content_type: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsListWebhooksResponseValidator(status, body) ctx.status = status return next() }) @@ -25270,6 +25833,15 @@ export function bootstrap( active: z.coerce.boolean().optional(), }) + const orgsCreateWebhookResponseValidator = responseValidationFactory( + [ + ["201", s_org_hook], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post("orgsCreateWebhook", "/orgs/:org/hooks", async (ctx, next) => { const input = { params: parseRequestInput(orgsCreateWebhookParamSchema, ctx.params), @@ -25279,14 +25851,7 @@ export function bootstrap( const { status, body } = await implementation.orgsCreateWebhook(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_org_hook], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsCreateWebhookResponseValidator(status, body) ctx.status = status return next() }) @@ -25296,6 +25861,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const orgsGetWebhookResponseValidator = responseValidationFactory( + [ + ["200", s_org_hook], + ["404", s_basic_error], + ], + undefined + ) + router.get( "orgsGetWebhook", "/orgs/:org/hooks/:hookId", @@ -25308,13 +25881,7 @@ export function bootstrap( const { status, body } = await implementation.orgsGetWebhook(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_org_hook], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsGetWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -25341,6 +25908,15 @@ export function bootstrap( }) .optional() + const orgsUpdateWebhookResponseValidator = responseValidationFactory( + [ + ["200", s_org_hook], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "orgsUpdateWebhook", "/orgs/:org/hooks/:hookId", @@ -25356,14 +25932,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_org_hook], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsUpdateWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -25374,6 +25943,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const orgsDeleteWebhookResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "orgsDeleteWebhook", "/orgs/:org/hooks/:hookId", @@ -25389,13 +25966,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsDeleteWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -25406,6 +25977,11 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const orgsGetWebhookConfigForOrgResponseValidator = responseValidationFactory( + [["200", s_webhook_config]], + undefined + ) + router.get( "orgsGetWebhookConfigForOrg", "/orgs/:org/hooks/:hookId/config", @@ -25424,10 +26000,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_webhook_config]], - undefined - )(status, body) + ctx.body = orgsGetWebhookConfigForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -25447,6 +26020,9 @@ export function bootstrap( }) .optional() + const orgsUpdateWebhookConfigForOrgResponseValidator = + responseValidationFactory([["200", s_webhook_config]], undefined) + router.patch( "orgsUpdateWebhookConfigForOrg", "/orgs/:org/hooks/:hookId/config", @@ -25466,10 +26042,7 @@ export function bootstrap( const { status, body } = await implementation.orgsUpdateWebhookConfigForOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_webhook_config]], - undefined - )(status, body) + ctx.body = orgsUpdateWebhookConfigForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -25486,6 +26059,32 @@ export function bootstrap( redelivery: z.coerce.boolean().optional(), }) + const orgsListWebhookDeliveriesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), + ], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "orgsListWebhookDeliveries", "/orgs/:org/hooks/:hookId/deliveries", @@ -25507,31 +26106,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ), - ], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsListWebhookDeliveriesResponseValidator(status, body) ctx.status = status return next() } @@ -25543,6 +26118,15 @@ export function bootstrap( delivery_id: z.coerce.number(), }) + const orgsGetWebhookDeliveryResponseValidator = responseValidationFactory( + [ + ["200", s_hook_delivery], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "orgsGetWebhookDelivery", "/orgs/:org/hooks/:hookId/deliveries/:deliveryId", @@ -25561,14 +26145,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_hook_delivery], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsGetWebhookDeliveryResponseValidator(status, body) ctx.status = status return next() } @@ -25580,6 +26157,16 @@ export function bootstrap( delivery_id: z.coerce.number(), }) + const orgsRedeliverWebhookDeliveryResponseValidator = + responseValidationFactory( + [ + ["202", z.object({})], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "orgsRedeliverWebhookDelivery", "/orgs/:org/hooks/:hookId/deliveries/:deliveryId/attempts", @@ -25596,14 +26183,7 @@ export function bootstrap( const { status, body } = await implementation.orgsRedeliverWebhookDelivery(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsRedeliverWebhookDeliveryResponseValidator(status, body) ctx.status = status return next() } @@ -25614,6 +26194,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const orgsPingWebhookResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.post( "orgsPingWebhook", "/orgs/:org/hooks/:hookId/pings", @@ -25626,13 +26214,7 @@ export function bootstrap( const { status, body } = await implementation.orgsPingWebhook(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsPingWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -25640,6 +26222,11 @@ export function bootstrap( const appsGetOrgInstallationParamSchema = z.object({ org: z.coerce.string() }) + const appsGetOrgInstallationResponseValidator = responseValidationFactory( + [["200", s_installation]], + undefined + ) + router.get( "appsGetOrgInstallation", "/orgs/:org/installation", @@ -25658,10 +26245,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_installation]], - undefined - )(status, body) + ctx.body = appsGetOrgInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -25676,6 +26260,112 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListAppInstallationsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + installations: z.array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z.enum(["read", "write"]).optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "orgsListAppInstallations", "/orgs/:org/installations", @@ -25697,115 +26387,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - installations: z.array( - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z - .enum(["read", "write"]) - .optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = orgsListAppInstallationsResponseValidator(status, body) ctx.status = status return next() } @@ -25815,6 +26397,9 @@ export function bootstrap( org: z.coerce.string(), }) + const interactionsGetRestrictionsForOrgResponseValidator = + responseValidationFactory([["200", z.object({})]], undefined) + router.get( "interactionsGetRestrictionsForOrg", "/orgs/:org/interaction-limits", @@ -25831,7 +26416,7 @@ export function bootstrap( const { status, body } = await implementation.interactionsGetRestrictionsForOrg(input, ctx) - ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + ctx.body = interactionsGetRestrictionsForOrgResponseValidator( status, body ) @@ -25846,6 +26431,15 @@ export function bootstrap( const interactionsSetRestrictionsForOrgBodySchema = s_interaction_limit + const interactionsSetRestrictionsForOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_interaction_limit_response], + ["422", s_validation_error], + ], + undefined + ) + router.put( "interactionsSetRestrictionsForOrg", "/orgs/:org/interaction-limits", @@ -25865,13 +26459,10 @@ export function bootstrap( const { status, body } = await implementation.interactionsSetRestrictionsForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_interaction_limit_response], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = interactionsSetRestrictionsForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -25881,6 +26472,9 @@ export function bootstrap( org: z.coerce.string(), }) + const interactionsRemoveRestrictionsForOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "interactionsRemoveRestrictionsForOrg", "/orgs/:org/interaction-limits", @@ -25897,7 +26491,7 @@ export function bootstrap( const { status, body } = await implementation.interactionsRemoveRestrictionsForOrg(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = interactionsRemoveRestrictionsForOrgResponseValidator( status, body ) @@ -25915,6 +26509,54 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListPendingInvitationsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "orgsListPendingInvitations", "/orgs/:org/invitations", @@ -25936,53 +26578,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsListPendingInvitationsResponseValidator(status, body) ctx.status = status return next() } @@ -25999,6 +26595,15 @@ export function bootstrap( }) .optional() + const orgsCreateInvitationResponseValidator = responseValidationFactory( + [ + ["201", s_organization_invitation], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "orgsCreateInvitation", "/orgs/:org/invitations", @@ -26014,14 +26619,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_organization_invitation], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsCreateInvitationResponseValidator(status, body) ctx.status = status return next() } @@ -26032,6 +26630,15 @@ export function bootstrap( invitation_id: z.coerce.number(), }) + const orgsCancelInvitationResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "orgsCancelInvitation", "/orgs/:org/invitations/:invitationId", @@ -26047,14 +26654,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsCancelInvitationResponseValidator(status, body) ctx.status = status return next() } @@ -26070,71 +26670,73 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "orgsListInvitationTeams", - "/orgs/:org/invitations/:invitationId/teams", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsListInvitationTeamsParamSchema, - ctx.params - ), - query: parseRequestInput(orgsListInvitationTeamsQuerySchema, ctx.query), - body: undefined, - } + const orgsListInvitationTeamsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "orgsListInvitationTeams", + "/orgs/:org/invitations/:invitationId/teams", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsListInvitationTeamsParamSchema, + ctx.params + ), + query: parseRequestInput(orgsListInvitationTeamsQuerySchema, ctx.query), + body: undefined, + } const { status, body } = await implementation.orgsListInvitationTeams( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsListInvitationTeamsResponseValidator(status, body) ctx.status = status return next() } @@ -26155,37 +26757,125 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("issuesListForOrg", "/orgs/:org/issues", async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListForOrgParamSchema, ctx.params), - query: parseRequestInput(issuesListForOrgQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListForOrg(input, ctx) - - ctx.body = responseValidationFactory( + const issuesListForOrgResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26208,21 +26898,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26244,10 +26947,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26270,19 +26990,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26305,34 +27024,241 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26354,392 +27280,70 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ["404", s_basic_error], + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), ], - undefined - )(status, body) + ["404", s_basic_error], + ], + undefined + ) + + router.get("issuesListForOrg", "/orgs/:org/issues", async (ctx, next) => { + const input = { + params: parseRequestInput(issuesListForOrgParamSchema, ctx.params), + query: parseRequestInput(issuesListForOrgQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListForOrg(input, ctx) + + ctx.body = issuesListForOrgResponseValidator(status, body) ctx.status = status return next() }) @@ -26753,6 +27357,41 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListMembersResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.get("orgsListMembers", "/orgs/:org/members", async (ctx, next) => { const input = { params: parseRequestInput(orgsListMembersParamSchema, ctx.params), @@ -26762,40 +27401,7 @@ export function bootstrap( const { status, body } = await implementation.orgsListMembers(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsListMembersResponseValidator(status, body) ctx.status = status return next() }) @@ -26805,6 +27411,15 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsCheckMembershipForUserResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["302", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "orgsCheckMembershipForUser", "/orgs/:org/members/:username", @@ -26823,14 +27438,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["302", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = orgsCheckMembershipForUserResponseValidator(status, body) ctx.status = status return next() } @@ -26841,6 +27449,14 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsRemoveMemberResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ], + undefined + ) + router.delete( "orgsRemoveMember", "/orgs/:org/members/:username", @@ -26853,13 +27469,7 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveMember(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsRemoveMemberResponseValidator(status, body) ctx.status = status return next() } @@ -26875,61 +27485,71 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "codespacesGetCodespacesForUserInOrg", - "/orgs/:org/members/:username/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesGetCodespacesForUserInOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesGetCodespacesForUserInOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesGetCodespacesForUserInOrg(input, ctx) - - ctx.body = responseValidationFactory( + const codespacesGetCodespacesForUserInOrgResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - billable_owner: z.object({ + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -26952,257 +27572,251 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce + created_at: z.coerce .string() + .datetime({ offset: true }) .optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce + updated_at: z.coerce .string() .datetime({ offset: true }) .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }), ], - undefined - )(status, body) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + + router.get( + "codespacesGetCodespacesForUserInOrg", + "/orgs/:org/members/:username/codespaces", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesGetCodespacesForUserInOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesGetCodespacesForUserInOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesGetCodespacesForUserInOrg(input, ctx) + + ctx.body = codespacesGetCodespacesForUserInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -27214,6 +27828,19 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesDeleteFromOrganizationResponseValidator = + responseValidationFactory( + [ + ["202", z.object({})], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.delete( "codespacesDeleteFromOrganization", "/orgs/:org/members/:username/codespaces/:codespaceName", @@ -27230,17 +27857,7 @@ export function bootstrap( const { status, body } = await implementation.codespacesDeleteFromOrganization(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesDeleteFromOrganizationResponseValidator(status, body) ctx.status = status return next() } @@ -27252,6 +27869,19 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesStopInOrganizationResponseValidator = + responseValidationFactory( + [ + ["200", s_codespace], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.post( "codespacesStopInOrganization", "/orgs/:org/members/:username/codespaces/:codespaceName/stop", @@ -27268,17 +27898,7 @@ export function bootstrap( const { status, body } = await implementation.codespacesStopInOrganization(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_codespace], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesStopInOrganizationResponseValidator(status, body) ctx.status = status return next() } @@ -27289,6 +27909,15 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsGetMembershipForUserResponseValidator = responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "orgsGetMembershipForUser", "/orgs/:org/memberships/:username", @@ -27307,14 +27936,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_org_membership], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsGetMembershipForUserResponseValidator(status, body) ctx.status = status return next() } @@ -27329,6 +27951,15 @@ export function bootstrap( .object({ role: z.enum(["admin", "member"]).optional() }) .optional() + const orgsSetMembershipForUserResponseValidator = responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "orgsSetMembershipForUser", "/orgs/:org/memberships/:username", @@ -27347,14 +27978,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_org_membership], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = orgsSetMembershipForUserResponseValidator(status, body) ctx.status = status return next() } @@ -27365,6 +27989,16 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsRemoveMembershipForUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "orgsRemoveMembershipForUser", "/orgs/:org/memberships/:username", @@ -27383,14 +28017,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsRemoveMembershipForUserResponseValidator(status, body) ctx.status = status return next() } @@ -27404,331 +28031,291 @@ export function bootstrap( exclude: z.array(z.enum(["repositories"])).optional(), }) - router.get( - "migrationsListForOrg", - "/orgs/:org/migrations", - async (ctx, next) => { - const input = { - params: parseRequestInput(migrationsListForOrgParamSchema, ctx.params), - query: parseRequestInput(migrationsListForOrgQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.migrationsListForOrg( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( + const migrationsListForOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( z.object({ id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z .object({ + login: z.coerce.string().optional(), id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -27750,48 +28337,97 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsStartForOrgParamSchema = z.object({ org: z.coerce.string() }) - - const migrationsStartForOrgBodySchema = z.object({ - repositories: z.array(z.coerce.string()), - lock_repositories: z.coerce.boolean().optional(), - exclude_metadata: z.coerce.boolean().optional(), - exclude_git_data: z.coerce.boolean().optional(), - exclude_attachments: z.coerce.boolean().optional(), + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + ), + ], + ], + undefined + ) + + router.get( + "migrationsListForOrg", + "/orgs/:org/migrations", + async (ctx, next) => { + const input = { + params: parseRequestInput(migrationsListForOrgParamSchema, ctx.params), + query: parseRequestInput(migrationsListForOrgQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.migrationsListForOrg( + input, + ctx + ) + + ctx.body = migrationsListForOrgResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const migrationsStartForOrgParamSchema = z.object({ org: z.coerce.string() }) + + const migrationsStartForOrgBodySchema = z.object({ + repositories: z.array(z.coerce.string()), + lock_repositories: z.coerce.boolean().optional(), + exclude_metadata: z.coerce.boolean().optional(), + exclude_git_data: z.coerce.boolean().optional(), + exclude_attachments: z.coerce.boolean().optional(), exclude_releases: z.coerce.boolean().optional(), exclude_owner_projects: z.coerce.boolean().optional(), org_metadata_only: z.coerce.boolean().optional(), exclude: z.array(z.enum(["repositories"])).optional(), }) + const migrationsStartForOrgResponseValidator = responseValidationFactory( + [ + ["201", s_migration], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "migrationsStartForOrg", "/orgs/:org/migrations", @@ -27807,14 +28443,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_migration], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = migrationsStartForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -27829,6 +28458,14 @@ export function bootstrap( exclude: z.array(z.enum(["repositories"])).optional(), }) + const migrationsGetStatusForOrgResponseValidator = responseValidationFactory( + [ + ["200", s_migration], + ["404", s_basic_error], + ], + undefined + ) + router.get( "migrationsGetStatusForOrg", "/orgs/:org/migrations/:migrationId", @@ -27850,13 +28487,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_migration], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsGetStatusForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -27867,6 +28498,15 @@ export function bootstrap( migration_id: z.coerce.number(), }) + const migrationsDownloadArchiveForOrgResponseValidator = + responseValidationFactory( + [ + ["302", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get( "migrationsDownloadArchiveForOrg", "/orgs/:org/migrations/:migrationId/archive", @@ -27883,13 +28523,7 @@ export function bootstrap( const { status, body } = await implementation.migrationsDownloadArchiveForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["302", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsDownloadArchiveForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -27900,6 +28534,15 @@ export function bootstrap( migration_id: z.coerce.number(), }) + const migrationsDeleteArchiveForOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "migrationsDeleteArchiveForOrg", "/orgs/:org/migrations/:migrationId/archive", @@ -27916,13 +28559,7 @@ export function bootstrap( const { status, body } = await implementation.migrationsDeleteArchiveForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsDeleteArchiveForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -27934,6 +28571,14 @@ export function bootstrap( repo_name: z.coerce.string(), }) + const migrationsUnlockRepoForOrgResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "migrationsUnlockRepoForOrg", "/orgs/:org/migrations/:migrationId/repos/:repoName/lock", @@ -27952,13 +28597,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsUnlockRepoForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -27974,6 +28613,171 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const migrationsListReposForOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "migrationsListReposForOrg", "/orgs/:org/migrations/:migrationId/repositories", @@ -27995,179 +28799,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsListReposForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -28183,6 +28815,41 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListOutsideCollaboratorsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "orgsListOutsideCollaborators", "/orgs/:org/outside_collaborators", @@ -28202,39 +28869,7 @@ export function bootstrap( const { status, body } = await implementation.orgsListOutsideCollaborators(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = orgsListOutsideCollaboratorsResponseValidator(status, body) ctx.status = status return next() } @@ -28249,6 +28884,17 @@ export function bootstrap( .object({ async: z.coerce.boolean().optional() }) .optional() + const orgsConvertMemberToOutsideCollaboratorResponseValidator = + responseValidationFactory( + [ + ["202", z.object({})], + ["204", z.void()], + ["403", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.put( "orgsConvertMemberToOutsideCollaborator", "/orgs/:org/outside_collaborators/:username", @@ -28268,15 +28914,10 @@ export function bootstrap( const { status, body } = await implementation.orgsConvertMemberToOutsideCollaborator(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["204", z.void()], - ["403", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsConvertMemberToOutsideCollaboratorResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -28287,6 +28928,21 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsRemoveOutsideCollaboratorResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + [ + "422", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.delete( "orgsRemoveOutsideCollaborator", "/orgs/:org/outside_collaborators/:username", @@ -28303,19 +28959,7 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveOutsideCollaborator(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "422", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = orgsRemoveOutsideCollaboratorResponseValidator(status, body) ctx.status = status return next() } @@ -28337,47 +28981,59 @@ export function bootstrap( visibility: z.enum(["public", "private", "internal"]).optional(), }) - router.get( - "packagesListPackagesForOrganization", - "/orgs/:org/packages", - async (ctx, next) => { - const input = { - params: parseRequestInput( - packagesListPackagesForOrganizationParamSchema, - ctx.params - ), - query: parseRequestInput( - packagesListPackagesForOrganizationQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.packagesListPackagesForOrganization(input, ctx) - - ctx.body = responseValidationFactory( + const packagesListPackagesForOrganizationResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -28399,182 +29055,176 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["401", s_basic_error], - ["403", s_basic_error], + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + + router.get( + "packagesListPackagesForOrganization", + "/orgs/:org/packages", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesListPackagesForOrganizationParamSchema, + ctx.params + ), + query: parseRequestInput( + packagesListPackagesForOrganizationQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.packagesListPackagesForOrganization(input, ctx) + + ctx.body = packagesListPackagesForOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -28593,6 +29243,9 @@ export function bootstrap( org: z.coerce.string(), }) + const packagesGetPackageForOrganizationResponseValidator = + responseValidationFactory([["200", s_package]], undefined) + router.get( "packagesGetPackageForOrganization", "/orgs/:org/packages/:packageType/:packageName", @@ -28609,7 +29262,7 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageForOrganization(input, ctx) - ctx.body = responseValidationFactory([["200", s_package]], undefined)( + ctx.body = packagesGetPackageForOrganizationResponseValidator( status, body ) @@ -28631,6 +29284,17 @@ export function bootstrap( org: z.coerce.string(), }) + const packagesDeletePackageForOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "packagesDeletePackageForOrg", "/orgs/:org/packages/:packageType/:packageName", @@ -28649,15 +29313,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesDeletePackageForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -28680,6 +29336,17 @@ export function bootstrap( token: z.coerce.string().optional(), }) + const packagesRestorePackageForOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "packagesRestorePackageForOrg", "/orgs/:org/packages/:packageType/:packageName/restore", @@ -28699,15 +29366,7 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesRestorePackageForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -28736,6 +29395,54 @@ export function bootstrap( } ) + const packagesGetAllPackageVersionsForPackageOwnedByOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ), + ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "packagesGetAllPackageVersionsForPackageOwnedByOrg", "/orgs/:org/packages/:packageType/:packageName/versions", @@ -28758,52 +29465,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - ), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + packagesGetAllPackageVersionsForPackageOwnedByOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -28823,6 +29489,9 @@ export function bootstrap( package_version_id: z.coerce.number(), }) + const packagesGetPackageVersionForOrganizationResponseValidator = + responseValidationFactory([["200", s_package_version]], undefined) + router.get( "packagesGetPackageVersionForOrganization", "/orgs/:org/packages/:packageType/:packageName/versions/:packageVersionId", @@ -28842,10 +29511,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_package_version]], - undefined - )(status, body) + ctx.body = packagesGetPackageVersionForOrganizationResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -28865,6 +29534,17 @@ export function bootstrap( package_version_id: z.coerce.number(), }) + const packagesDeletePackageVersionForOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "packagesDeletePackageVersionForOrg", "/orgs/:org/packages/:packageType/:packageName/versions/:packageVersionId", @@ -28881,15 +29561,10 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageVersionForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesDeletePackageVersionForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -28909,6 +29584,17 @@ export function bootstrap( package_version_id: z.coerce.number(), }) + const packagesRestorePackageVersionForOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "packagesRestorePackageVersionForOrg", "/orgs/:org/packages/:packageType/:packageName/versions/:packageVersionId/restore", @@ -28925,15 +29611,10 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageVersionForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesRestorePackageVersionForOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -28947,6 +29628,59 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const projectsListForOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + ["422", s_validation_error_simple], + ], + undefined + ) + router.get("projectsListForOrg", "/orgs/:org/projects", async (ctx, next) => { const input = { params: parseRequestInput(projectsListForOrgParamSchema, ctx.params), @@ -28956,58 +29690,7 @@ export function bootstrap( const { status, body } = await implementation.projectsListForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - ), - ], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsListForOrgResponseValidator(status, body) ctx.status = status return next() }) @@ -29019,6 +29702,18 @@ export function bootstrap( body: z.coerce.string().optional(), }) + const projectsCreateForOrgResponseValidator = responseValidationFactory( + [ + ["201", s_project], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "projectsCreateForOrg", "/orgs/:org/projects", @@ -29034,17 +29729,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_project], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsCreateForOrgResponseValidator(status, body) ctx.status = status return next() } @@ -29057,6 +29742,40 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListPublicMembersResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "orgsListPublicMembers", "/orgs/:org/public_members", @@ -29072,39 +29791,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = orgsListPublicMembersResponseValidator(status, body) ctx.status = status return next() } @@ -29115,6 +29802,15 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsCheckPublicMembershipForUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "orgsCheckPublicMembershipForUser", "/orgs/:org/public_members/:username", @@ -29131,13 +29827,7 @@ export function bootstrap( const { status, body } = await implementation.orgsCheckPublicMembershipForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = orgsCheckPublicMembershipForUserResponseValidator(status, body) ctx.status = status return next() } @@ -29148,9 +29838,18 @@ export function bootstrap( username: z.coerce.string(), }) - router.put( - "orgsSetPublicMembershipForAuthenticatedUser", - "/orgs/:org/public_members/:username", + const orgsSetPublicMembershipForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ], + undefined + ) + + router.put( + "orgsSetPublicMembershipForAuthenticatedUser", + "/orgs/:org/public_members/:username", async (ctx, next) => { const input = { params: parseRequestInput( @@ -29167,13 +29866,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsSetPublicMembershipForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -29184,6 +29880,9 @@ export function bootstrap( username: z.coerce.string(), }) + const orgsRemovePublicMembershipForAuthenticatedUserResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "orgsRemovePublicMembershipForAuthenticatedUser", "/orgs/:org/public_members/:username", @@ -29203,10 +29902,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + orgsRemovePublicMembershipForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -29224,6 +29924,170 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListForOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get("reposListForOrg", "/orgs/:org/repos", async (ctx, next) => { const input = { params: parseRequestInput(reposListForOrgParamSchema, ctx.params), @@ -29233,178 +30097,7 @@ export function bootstrap( const { status, body } = await implementation.reposListForOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListForOrgResponseValidator(status, body) ctx.status = status return next() }) @@ -29442,6 +30135,15 @@ export function bootstrap( merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), }) + const reposCreateInOrgResponseValidator = responseValidationFactory( + [ + ["201", s_repository], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post("reposCreateInOrg", "/orgs/:org/repos", async (ctx, next) => { const input = { params: parseRequestInput(reposCreateInOrgParamSchema, ctx.params), @@ -29451,14 +30153,7 @@ export function bootstrap( const { status, body } = await implementation.reposCreateInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_repository], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateInOrgResponseValidator(status, body) ctx.status = status return next() }) @@ -29479,160 +30174,74 @@ export function bootstrap( after: z.coerce.string().optional(), }) - router.get( - "secretScanningListAlertsForOrg", - "/orgs/:org/secret-scanning/alerts", - async (ctx, next) => { - const input = { - params: parseRequestInput( - secretScanningListAlertsForOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - secretScanningListAlertsForOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.secretScanningListAlertsForOrg(input, ctx) - - ctx.body = responseValidationFactory( + const secretScanningListAlertsForOrgResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - hooks_url: z.coerce.string(), - }) - .optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ + "200", + z.array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -29654,98 +30263,198 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolution_comment: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsListSecurityManagerTeamsParamSchema = z.object({ - org: z.coerce.string(), - }) - - router.get( - "orgsListSecurityManagerTeams", - "/orgs/:org/security-managers", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsListSecurityManagerTeamsParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.orgsListSecurityManagerTeams(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsAddSecurityManagerTeamParamSchema = z.object({ - org: z.coerce.string(), - team_slug: z.coerce.string(), - }) - - router.put( - "orgsAddSecurityManagerTeam", - "/orgs/:org/security-managers/teams/:teamSlug", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsAddSecurityManagerTeamParamSchema, - ctx.params - ), - query: undefined, - body: undefined, + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + hooks_url: z.coerce.string(), + }) + .optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolution_comment: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + + router.get( + "secretScanningListAlertsForOrg", + "/orgs/:org/secret-scanning/alerts", + async (ctx, next) => { + const input = { + params: parseRequestInput( + secretScanningListAlertsForOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + secretScanningListAlertsForOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.secretScanningListAlertsForOrg(input, ctx) + + ctx.body = secretScanningListAlertsForOrgResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const orgsListSecurityManagerTeamsParamSchema = z.object({ + org: z.coerce.string(), + }) + + const orgsListSecurityManagerTeamsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + + router.get( + "orgsListSecurityManagerTeams", + "/orgs/:org/security-managers", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsListSecurityManagerTeamsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.orgsListSecurityManagerTeams(input, ctx) + + ctx.body = orgsListSecurityManagerTeamsResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const orgsAddSecurityManagerTeamParamSchema = z.object({ + org: z.coerce.string(), + team_slug: z.coerce.string(), + }) + + const orgsAddSecurityManagerTeamResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + + router.put( + "orgsAddSecurityManagerTeam", + "/orgs/:org/security-managers/teams/:teamSlug", + async (ctx, next) => { + const input = { + params: parseRequestInput( + orgsAddSecurityManagerTeamParamSchema, + ctx.params + ), + query: undefined, + body: undefined, } const { status, body } = await implementation.orgsAddSecurityManagerTeam( @@ -29753,13 +30462,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = orgsAddSecurityManagerTeamResponseValidator(status, body) ctx.status = status return next() } @@ -29770,6 +30473,9 @@ export function bootstrap( team_slug: z.coerce.string(), }) + const orgsRemoveSecurityManagerTeamResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "orgsRemoveSecurityManagerTeam", "/orgs/:org/security-managers/teams/:teamSlug", @@ -29786,10 +30492,7 @@ export function bootstrap( const { status, body } = await implementation.orgsRemoveSecurityManagerTeam(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = orgsRemoveSecurityManagerTeamResponseValidator(status, body) ctx.status = status return next() } @@ -29799,6 +30502,9 @@ export function bootstrap( org: z.coerce.string(), }) + const billingGetGithubActionsBillingOrgResponseValidator = + responseValidationFactory([["200", s_actions_billing_usage]], undefined) + router.get( "billingGetGithubActionsBillingOrg", "/orgs/:org/settings/billing/actions", @@ -29815,10 +30521,10 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubActionsBillingOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_actions_billing_usage]], - undefined - )(status, body) + ctx.body = billingGetGithubActionsBillingOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -29828,6 +30534,9 @@ export function bootstrap( org: z.coerce.string(), }) + const billingGetGithubPackagesBillingOrgResponseValidator = + responseValidationFactory([["200", s_packages_billing_usage]], undefined) + router.get( "billingGetGithubPackagesBillingOrg", "/orgs/:org/settings/billing/packages", @@ -29844,10 +30553,10 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubPackagesBillingOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_packages_billing_usage]], - undefined - )(status, body) + ctx.body = billingGetGithubPackagesBillingOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -29857,6 +30566,9 @@ export function bootstrap( org: z.coerce.string(), }) + const billingGetSharedStorageBillingOrgResponseValidator = + responseValidationFactory([["200", s_combined_billing_usage]], undefined) + router.get( "billingGetSharedStorageBillingOrg", "/orgs/:org/settings/billing/shared-storage", @@ -29873,10 +30585,10 @@ export function bootstrap( const { status, body } = await implementation.billingGetSharedStorageBillingOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_combined_billing_usage]], - undefined - )(status, body) + ctx.body = billingGetSharedStorageBillingOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -29889,62 +30601,64 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("teamsList", "/orgs/:org/teams", async (ctx, next) => { - const input = { - params: parseRequestInput(teamsListParamSchema, ctx.params), - query: parseRequestInput(teamsListQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.teamsList(input, ctx) - - ctx.body = responseValidationFactory( + const teamsListResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), - slug: z.coerce.string(), description: z.coerce.string(), - privacy: z.coerce.string().optional(), permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - members_url: z.coerce.string(), repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["403", s_basic_error], + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), ], - undefined - )(status, body) + ["403", s_basic_error], + ], + undefined + ) + + router.get("teamsList", "/orgs/:org/teams", async (ctx, next) => { + const input = { + params: parseRequestInput(teamsListParamSchema, ctx.params), + query: parseRequestInput(teamsListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.teamsList(input, ctx) + + ctx.body = teamsListResponseValidator(status, body) ctx.status = status return next() }) @@ -29961,6 +30675,15 @@ export function bootstrap( parent_team_id: z.coerce.number().optional(), }) + const teamsCreateResponseValidator = responseValidationFactory( + [ + ["201", s_team_full], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post("teamsCreate", "/orgs/:org/teams", async (ctx, next) => { const input = { params: parseRequestInput(teamsCreateParamSchema, ctx.params), @@ -29970,14 +30693,7 @@ export function bootstrap( const { status, body } = await implementation.teamsCreate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_team_full], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsCreateResponseValidator(status, body) ctx.status = status return next() }) @@ -29987,6 +30703,14 @@ export function bootstrap( team_slug: z.coerce.string(), }) + const teamsGetByNameResponseValidator = responseValidationFactory( + [ + ["200", s_team_full], + ["404", s_basic_error], + ], + undefined + ) + router.get( "teamsGetByName", "/orgs/:org/teams/:teamSlug", @@ -29999,13 +30723,7 @@ export function bootstrap( const { status, body } = await implementation.teamsGetByName(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_full], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = teamsGetByNameResponseValidator(status, body) ctx.status = status return next() } @@ -30026,6 +30744,17 @@ export function bootstrap( }) .optional() + const teamsUpdateInOrgResponseValidator = responseValidationFactory( + [ + ["200", s_team_full], + ["201", s_team_full], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "teamsUpdateInOrg", "/orgs/:org/teams/:teamSlug", @@ -30038,16 +30767,7 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_full], - ["201", s_team_full], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsUpdateInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30058,6 +30778,11 @@ export function bootstrap( team_slug: z.coerce.string(), }) + const teamsDeleteInOrgResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "teamsDeleteInOrg", "/orgs/:org/teams/:teamSlug", @@ -30070,10 +30795,7 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteInOrg(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = teamsDeleteInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30091,6 +30813,72 @@ export function bootstrap( pinned: z.coerce.string().optional(), }) + const teamsListDiscussionsInOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListDiscussionsInOrg", "/orgs/:org/teams/:teamSlug/discussions", @@ -30112,71 +30900,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListDiscussionsInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30193,6 +30917,11 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) + const teamsCreateDiscussionInOrgResponseValidator = responseValidationFactory( + [["201", s_team_discussion]], + undefined + ) + router.post( "teamsCreateDiscussionInOrg", "/orgs/:org/teams/:teamSlug/discussions", @@ -30211,10 +30940,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_team_discussion]], - undefined - )(status, body) + ctx.body = teamsCreateDiscussionInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30226,6 +30952,11 @@ export function bootstrap( discussion_number: z.coerce.number(), }) + const teamsGetDiscussionInOrgResponseValidator = responseValidationFactory( + [["200", s_team_discussion]], + undefined + ) + router.get( "teamsGetDiscussionInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber", @@ -30244,10 +30975,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_team_discussion]], - undefined - )(status, body) + ctx.body = teamsGetDiscussionInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30266,6 +30994,11 @@ export function bootstrap( }) .optional() + const teamsUpdateDiscussionInOrgResponseValidator = responseValidationFactory( + [["200", s_team_discussion]], + undefined + ) + router.patch( "teamsUpdateDiscussionInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber", @@ -30284,10 +31017,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_team_discussion]], - undefined - )(status, body) + ctx.body = teamsUpdateDiscussionInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30299,6 +31029,11 @@ export function bootstrap( discussion_number: z.coerce.number(), }) + const teamsDeleteDiscussionInOrgResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "teamsDeleteDiscussionInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber", @@ -30317,10 +31052,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = teamsDeleteDiscussionInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30338,6 +31070,68 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListDiscussionCommentsInOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListDiscussionCommentsInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments", @@ -30357,66 +31151,7 @@ export function bootstrap( const { status, body } = await implementation.teamsListDiscussionCommentsInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListDiscussionCommentsInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30432,6 +31167,9 @@ export function bootstrap( body: z.coerce.string(), }) + const teamsCreateDiscussionCommentInOrgResponseValidator = + responseValidationFactory([["201", s_team_discussion_comment]], undefined) + router.post( "teamsCreateDiscussionCommentInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments", @@ -30451,10 +31189,10 @@ export function bootstrap( const { status, body } = await implementation.teamsCreateDiscussionCommentInOrg(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_team_discussion_comment]], - undefined - )(status, body) + ctx.body = teamsCreateDiscussionCommentInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -30467,6 +31205,9 @@ export function bootstrap( comment_number: z.coerce.number(), }) + const teamsGetDiscussionCommentInOrgResponseValidator = + responseValidationFactory([["200", s_team_discussion_comment]], undefined) + router.get( "teamsGetDiscussionCommentInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber", @@ -30483,10 +31224,7 @@ export function bootstrap( const { status, body } = await implementation.teamsGetDiscussionCommentInOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_team_discussion_comment]], - undefined - )(status, body) + ctx.body = teamsGetDiscussionCommentInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -30503,6 +31241,9 @@ export function bootstrap( body: z.coerce.string(), }) + const teamsUpdateDiscussionCommentInOrgResponseValidator = + responseValidationFactory([["200", s_team_discussion_comment]], undefined) + router.patch( "teamsUpdateDiscussionCommentInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber", @@ -30522,10 +31263,10 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateDiscussionCommentInOrg(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_team_discussion_comment]], - undefined - )(status, body) + ctx.body = teamsUpdateDiscussionCommentInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -30538,6 +31279,9 @@ export function bootstrap( comment_number: z.coerce.number(), }) + const teamsDeleteDiscussionCommentInOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "teamsDeleteDiscussionCommentInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber", @@ -30554,7 +31298,7 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteDiscussionCommentInOrg(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = teamsDeleteDiscussionCommentInOrgResponseValidator( status, body ) @@ -30587,76 +31331,82 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reactionsListForTeamDiscussionCommentInOrg", - "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber/reactions", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reactionsListForTeamDiscussionCommentInOrgParamSchema, - ctx.params - ), - query: parseRequestInput( - reactionsListForTeamDiscussionCommentInOrgQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reactionsListForTeamDiscussionCommentInOrg( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const reactionsListForTeamDiscussionCommentInOrgResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "reactionsListForTeamDiscussionCommentInOrg", + "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber/reactions", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reactionsListForTeamDiscussionCommentInOrgParamSchema, + ctx.params + ), + query: parseRequestInput( + reactionsListForTeamDiscussionCommentInOrgQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reactionsListForTeamDiscussionCommentInOrg( + input, + ctx + ) + + ctx.body = reactionsListForTeamDiscussionCommentInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -30682,6 +31432,15 @@ export function bootstrap( ]), }) + const reactionsCreateForTeamDiscussionCommentInOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ], + undefined + ) + router.post( "reactionsCreateForTeamDiscussionCommentInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber/reactions", @@ -30704,13 +31463,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForTeamDiscussionCommentInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -30724,6 +31480,9 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForTeamDiscussionCommentResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reactionsDeleteForTeamDiscussionComment", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/comments/:commentNumber/reactions/:reactionId", @@ -30740,7 +31499,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForTeamDiscussionComment(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = reactionsDeleteForTeamDiscussionCommentResponseValidator( status, body ) @@ -30772,6 +31531,56 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForTeamDiscussionInOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + router.get( "reactionsListForTeamDiscussionInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/reactions", @@ -30791,54 +31600,10 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForTeamDiscussionInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reactionsListForTeamDiscussionInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -30863,6 +31628,15 @@ export function bootstrap( ]), }) + const reactionsCreateForTeamDiscussionInOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ], + undefined + ) + router.post( "reactionsCreateForTeamDiscussionInOrg", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/reactions", @@ -30882,13 +31656,10 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForTeamDiscussionInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForTeamDiscussionInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -30901,6 +31672,9 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForTeamDiscussionResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reactionsDeleteForTeamDiscussion", "/orgs/:org/teams/:teamSlug/discussions/:discussionNumber/reactions/:reactionId", @@ -30917,10 +31691,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForTeamDiscussion(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reactionsDeleteForTeamDiscussionResponseValidator(status, body) ctx.status = status return next() } @@ -30936,6 +31707,54 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListPendingInvitationsInOrgResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListPendingInvitationsInOrg", "/orgs/:org/teams/:teamSlug/invitations", @@ -30955,52 +31774,7 @@ export function bootstrap( const { status, body } = await implementation.teamsListPendingInvitationsInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListPendingInvitationsInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31017,6 +31791,40 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListMembersInOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListMembersInOrg", "/orgs/:org/teams/:teamSlug/members", @@ -31032,39 +31840,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListMembersInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31076,6 +31852,15 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsGetMembershipForUserInOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_team_membership], + ["404", z.void()], + ], + undefined + ) + router.get( "teamsGetMembershipForUserInOrg", "/orgs/:org/teams/:teamSlug/memberships/:username", @@ -31092,13 +31877,7 @@ export function bootstrap( const { status, body } = await implementation.teamsGetMembershipForUserInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_membership], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsGetMembershipForUserInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31114,6 +31893,16 @@ export function bootstrap( .object({ role: z.enum(["member", "maintainer"]).optional() }) .optional() + const teamsAddOrUpdateMembershipForUserInOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_team_membership], + ["403", z.void()], + ["422", z.void()], + ], + undefined + ) + router.put( "teamsAddOrUpdateMembershipForUserInOrg", "/orgs/:org/teams/:teamSlug/memberships/:username", @@ -31133,14 +31922,10 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateMembershipForUserInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_membership], - ["403", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsAddOrUpdateMembershipForUserInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -31152,6 +31937,15 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsRemoveMembershipForUserInOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", z.void()], + ], + undefined + ) + router.delete( "teamsRemoveMembershipForUserInOrg", "/orgs/:org/teams/:teamSlug/memberships/:username", @@ -31168,13 +31962,10 @@ export function bootstrap( const { status, body } = await implementation.teamsRemoveMembershipForUserInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsRemoveMembershipForUserInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -31190,6 +31981,61 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListProjectsInOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListProjectsInOrg", "/orgs/:org/teams/:teamSlug/projects", @@ -31208,60 +32054,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListProjectsInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31273,6 +32066,15 @@ export function bootstrap( project_id: z.coerce.number(), }) + const teamsCheckPermissionsForProjectInOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_team_project], + ["404", z.void()], + ], + undefined + ) + router.get( "teamsCheckPermissionsForProjectInOrg", "/orgs/:org/teams/:teamSlug/projects/:projectId", @@ -31289,13 +32091,10 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForProjectInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_project], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsCheckPermissionsForProjectInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -31311,6 +32110,21 @@ export function bootstrap( .object({ permission: z.enum(["read", "write", "admin"]).optional() }) .optional() + const teamsAddOrUpdateProjectPermissionsInOrgResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.put( "teamsAddOrUpdateProjectPermissionsInOrg", "/orgs/:org/teams/:teamSlug/projects/:projectId", @@ -31330,19 +32144,10 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateProjectPermissionsInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = teamsAddOrUpdateProjectPermissionsInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -31354,6 +32159,11 @@ export function bootstrap( project_id: z.coerce.number(), }) + const teamsRemoveProjectInOrgResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "teamsRemoveProjectInOrg", "/orgs/:org/teams/:teamSlug/projects/:projectId", @@ -31372,10 +32182,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = teamsRemoveProjectInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31391,6 +32198,170 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListReposInOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListReposInOrg", "/orgs/:org/teams/:teamSlug/repos", @@ -31406,178 +32377,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListReposInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31590,6 +32390,16 @@ export function bootstrap( repo: z.coerce.string(), }) + const teamsCheckPermissionsForRepoInOrgResponseValidator = + responseValidationFactory( + [ + ["200", s_team_repository], + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "teamsCheckPermissionsForRepoInOrg", "/orgs/:org/teams/:teamSlug/repos/:owner/:repo", @@ -31606,14 +32416,10 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForRepoInOrg(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_repository], - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsCheckPermissionsForRepoInOrgResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -31630,6 +32436,9 @@ export function bootstrap( .object({ permission: z.coerce.string().optional() }) .optional() + const teamsAddOrUpdateRepoPermissionsInOrgResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "teamsAddOrUpdateRepoPermissionsInOrg", "/orgs/:org/teams/:teamSlug/repos/:owner/:repo", @@ -31649,7 +32458,7 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateRepoPermissionsInOrg(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = teamsAddOrUpdateRepoPermissionsInOrgResponseValidator( status, body ) @@ -31665,6 +32474,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const teamsRemoveRepoInOrgResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "teamsRemoveRepoInOrg", "/orgs/:org/teams/:teamSlug/repos/:owner/:repo", @@ -31680,10 +32494,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = teamsRemoveRepoInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31699,6 +32510,53 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListChildInOrgResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListChildInOrg", "/orgs/:org/teams/:teamSlug/teams", @@ -31714,52 +32572,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListChildInOrgResponseValidator(status, body) ctx.status = status return next() } @@ -31778,6 +32591,15 @@ export function bootstrap( enablement: z.enum(["enable_all", "disable_all"]), }) + const orgsEnableOrDisableSecurityProductOnAllOrgReposResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["422", z.void()], + ], + undefined + ) + router.post( "orgsEnableOrDisableSecurityProductOnAllOrgRepos", "/orgs/:org/:securityProduct/:enablement", @@ -31797,13 +32619,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = + orgsEnableOrDisableSecurityProductOnAllOrgReposResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -31811,6 +32631,17 @@ export function bootstrap( const projectsGetCardParamSchema = z.object({ card_id: z.coerce.number() }) + const projectsGetCardResponseValidator = responseValidationFactory( + [ + ["200", s_project_card], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "projectsGetCard", "/projects/columns/cards/:cardId", @@ -31823,16 +32654,7 @@ export function bootstrap( const { status, body } = await implementation.projectsGetCard(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_project_card], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsGetCardResponseValidator(status, body) ctx.status = status return next() } @@ -31847,6 +32669,18 @@ export function bootstrap( }) .optional() + const projectsUpdateCardResponseValidator = responseValidationFactory( + [ + ["200", s_project_card], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.patch( "projectsUpdateCard", "/projects/columns/cards/:cardId", @@ -31862,17 +32696,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_project_card], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsUpdateCardResponseValidator(status, body) ctx.status = status return next() } @@ -31880,6 +32704,24 @@ export function bootstrap( const projectsDeleteCardParamSchema = z.object({ card_id: z.coerce.number() }) + const projectsDeleteCardResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "projectsDeleteCard", "/projects/columns/cards/:cardId", @@ -31895,23 +32737,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsDeleteCardResponseValidator(status, body) ctx.status = status return next() } @@ -31924,6 +32750,49 @@ export function bootstrap( column_id: z.coerce.number().optional(), }) + const projectsMoveCardResponseValidator = responseValidationFactory( + [ + ["201", z.object({})], + ["304", z.void()], + ["401", s_basic_error], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + resource: z.coerce.string().optional(), + field: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + ], + undefined + ) + router.post( "projectsMoveCard", "/projects/columns/cards/:cardId/moves", @@ -31936,48 +32805,7 @@ export function bootstrap( const { status, body } = await implementation.projectsMoveCard(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - ["304", z.void()], - ["401", s_basic_error], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z - .array( - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - resource: z.coerce.string().optional(), - field: z.coerce.string().optional(), - }) - ) - .optional(), - }), - ], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z - .array( - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = projectsMoveCardResponseValidator(status, body) ctx.status = status return next() } @@ -31987,6 +32815,17 @@ export function bootstrap( column_id: z.coerce.number(), }) + const projectsGetColumnResponseValidator = responseValidationFactory( + [ + ["200", s_project_column], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "projectsGetColumn", "/projects/columns/:columnId", @@ -32002,16 +32841,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_project_column], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsGetColumnResponseValidator(status, body) ctx.status = status return next() } @@ -32023,6 +32853,16 @@ export function bootstrap( const projectsUpdateColumnBodySchema = z.object({ name: z.coerce.string() }) + const projectsUpdateColumnResponseValidator = responseValidationFactory( + [ + ["200", s_project_column], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.patch( "projectsUpdateColumn", "/projects/columns/:columnId", @@ -32038,15 +32878,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_project_column], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsUpdateColumnResponseValidator(status, body) ctx.status = status return next() } @@ -32056,6 +32888,16 @@ export function bootstrap( column_id: z.coerce.number(), }) + const projectsDeleteColumnResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.delete( "projectsDeleteColumn", "/projects/columns/:columnId", @@ -32071,15 +32913,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsDeleteColumnResponseValidator(status, body) ctx.status = status return next() } @@ -32095,6 +32929,57 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const projectsListCardsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + note: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + archived: z.coerce.boolean().optional(), + column_name: z.coerce.string().optional(), + project_id: z.coerce.string().optional(), + column_url: z.coerce.string(), + content_url: z.coerce.string().optional(), + project_url: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "projectsListCards", "/projects/columns/:columnId/cards", @@ -32110,56 +32995,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - note: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - archived: z.coerce.boolean().optional(), - column_name: z.coerce.string().optional(), - project_id: z.coerce.string().optional(), - column_url: z.coerce.string(), - content_url: z.coerce.string().optional(), - project_url: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsListCardsResponseValidator(status, body) ctx.status = status return next() } @@ -32177,6 +33013,33 @@ export function bootstrap( }), ]) + const projectsCreateCardResponseValidator = responseValidationFactory( + [ + ["201", s_project_card], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", z.union([s_validation_error, s_validation_error_simple])], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z + .array( + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + }) + ) + .optional(), + }), + ], + ], + undefined + ) + router.post( "projectsCreateCard", "/projects/columns/:columnId/cards", @@ -32192,32 +33055,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_project_card], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", z.union([s_validation_error, s_validation_error_simple])], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z - .array( - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = projectsCreateCardResponseValidator(status, body) ctx.status = status return next() } @@ -32229,6 +33067,17 @@ export function bootstrap( const projectsMoveColumnBodySchema = z.object({ position: z.coerce.string() }) + const projectsMoveColumnResponseValidator = responseValidationFactory( + [ + ["201", z.object({})], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "projectsMoveColumn", "/projects/columns/:columnId/moves", @@ -32244,16 +33093,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", z.object({})], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsMoveColumnResponseValidator(status, body) ctx.status = status return next() } @@ -32261,6 +33101,16 @@ export function bootstrap( const projectsGetParamSchema = z.object({ project_id: z.coerce.number() }) + const projectsGetResponseValidator = responseValidationFactory( + [ + ["200", s_project], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get("projectsGet", "/projects/:projectId", async (ctx, next) => { const input = { params: parseRequestInput(projectsGetParamSchema, ctx.params), @@ -32270,15 +33120,7 @@ export function bootstrap( const { status, body } = await implementation.projectsGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_project], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsGetResponseValidator(status, body) ctx.status = status return next() }) @@ -32297,6 +33139,26 @@ export function bootstrap( }) .optional() + const projectsUpdateResponseValidator = responseValidationFactory( + [ + ["200", s_project], + ["304", z.void()], + ["401", s_basic_error], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ["404", z.void()], + ["410", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.patch("projectsUpdate", "/projects/:projectId", async (ctx, next) => { const input = { params: parseRequestInput(projectsUpdateParamSchema, ctx.params), @@ -32306,31 +33168,32 @@ export function bootstrap( const { status, body } = await implementation.projectsUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_project], - ["304", z.void()], - ["401", s_basic_error], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ["404", z.void()], - ["410", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsUpdateResponseValidator(status, body) ctx.status = status return next() }) const projectsDeleteParamSchema = z.object({ project_id: z.coerce.number() }) + const projectsDeleteResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + errors: z.array(z.coerce.string()).optional(), + }), + ], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + router.delete("projectsDelete", "/projects/:projectId", async (ctx, next) => { const input = { params: parseRequestInput(projectsDeleteParamSchema, ctx.params), @@ -32340,24 +33203,7 @@ export function bootstrap( const { status, body } = await implementation.projectsDelete(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - errors: z.array(z.coerce.string()).optional(), - }), - ], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsDeleteResponseValidator(status, body) ctx.status = status return next() }) @@ -32372,6 +33218,45 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const projectsListCollaboratorsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "projectsListCollaborators", "/projects/:projectId/collaborators", @@ -32393,44 +33278,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = projectsListCollaboratorsResponseValidator(status, body) ctx.status = status return next() } @@ -32445,6 +33293,18 @@ export function bootstrap( .object({ permission: z.enum(["read", "write", "admin"]).optional() }) .optional() + const projectsAddCollaboratorResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "projectsAddCollaborator", "/projects/:projectId/collaborators/:username", @@ -32463,17 +33323,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = projectsAddCollaboratorResponseValidator(status, body) ctx.status = status return next() } @@ -32484,6 +33334,18 @@ export function bootstrap( username: z.coerce.string(), }) + const projectsRemoveCollaboratorResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "projectsRemoveCollaborator", "/projects/:projectId/collaborators/:username", @@ -32502,17 +33364,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = projectsRemoveCollaboratorResponseValidator(status, body) ctx.status = status return next() } @@ -32523,6 +33375,19 @@ export function bootstrap( username: z.coerce.string(), }) + const projectsGetPermissionForUserResponseValidator = + responseValidationFactory( + [ + ["200", s_project_collaborator_permission], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "projectsGetPermissionForUser", "/projects/:projectId/collaborators/:username/permission", @@ -32539,17 +33404,7 @@ export function bootstrap( const { status, body } = await implementation.projectsGetPermissionForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_project_collaborator_permission], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = projectsGetPermissionForUserResponseValidator(status, body) ctx.status = status return next() } @@ -32564,6 +33419,30 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const projectsListColumnsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + project_url: z.coerce.string(), + cards_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "projectsListColumns", "/projects/:projectId/columns", @@ -32579,29 +33458,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - project_url: z.coerce.string(), - cards_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = projectsListColumnsResponseValidator(status, body) ctx.status = status return next() } @@ -32613,6 +33470,17 @@ export function bootstrap( const projectsCreateColumnBodySchema = z.object({ name: z.coerce.string() }) + const projectsCreateColumnResponseValidator = responseValidationFactory( + [ + ["201", s_project_column], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "projectsCreateColumn", "/projects/:projectId/columns", @@ -32628,21 +33496,21 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_project_column], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsCreateColumnResponseValidator(status, body) ctx.status = status return next() } ) + const rateLimitGetResponseValidator = responseValidationFactory( + [ + ["200", s_rate_limit_overview], + ["304", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get("rateLimitGet", "/rate_limit", async (ctx, next) => { const input = { params: undefined, @@ -32652,14 +33520,7 @@ export function bootstrap( const { status, body } = await implementation.rateLimitGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_rate_limit_overview], - ["304", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = rateLimitGetResponseValidator(status, body) ctx.status = status return next() }) @@ -32674,213 +33535,216 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "actionsListRepoRequiredWorkflows", - "/repos/:org/:repo/actions/required_workflows", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListRepoRequiredWorkflowsParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListRepoRequiredWorkflowsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsListRepoRequiredWorkflows(input, ctx) - - ctx.body = responseValidationFactory( + const actionsListRepoRequiredWorkflowsResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - required_workflows: z.array( - z.object({ + "200", + z.object({ + total_count: z.coerce.number(), + required_workflows: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum(["active", "deleted"]), + source_repository: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum(["active", "deleted"]), - source_repository: z.object({ + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), + private: z.coerce.boolean(), html_url: z.coerce.string(), - badge_url: z.coerce.string(), - }) - ), - }), - ], - ["404", s_basic_error], + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + }) + ), + }), ], - undefined - )(status, body) + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "actionsListRepoRequiredWorkflows", + "/repos/:org/:repo/actions/required_workflows", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListRepoRequiredWorkflowsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListRepoRequiredWorkflowsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListRepoRequiredWorkflows(input, ctx) + + ctx.body = actionsListRepoRequiredWorkflowsResponseValidator(status, body) ctx.status = status return next() } @@ -32892,6 +33756,15 @@ export function bootstrap( required_workflow_id_for_repo: z.coerce.number(), }) + const actionsGetRepoRequiredWorkflowResponseValidator = + responseValidationFactory( + [ + ["200", s_repo_required_workflow], + ["404", s_basic_error], + ], + undefined + ) + router.get( "actionsGetRepoRequiredWorkflow", "/repos/:org/:repo/actions/required_workflows/:requiredWorkflowIdForRepo", @@ -32908,13 +33781,7 @@ export function bootstrap( const { status, body } = await implementation.actionsGetRepoRequiredWorkflow(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_repo_required_workflow], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsGetRepoRequiredWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -32926,6 +33793,15 @@ export function bootstrap( required_workflow_id_for_repo: z.coerce.number(), }) + const actionsGetRepoRequiredWorkflowUsageResponseValidator = + responseValidationFactory( + [ + ["200", s_workflow_usage], + ["404", s_basic_error], + ], + undefined + ) + router.get( "actionsGetRepoRequiredWorkflowUsage", "/repos/:org/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/timing", @@ -32942,13 +33818,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetRepoRequiredWorkflowUsage(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_workflow_usage], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsGetRepoRequiredWorkflowUsageResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -32959,6 +33832,16 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetResponseValidator = responseValidationFactory( + [ + ["200", s_full_repository], + ["301", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get("reposGet", "/repos/:owner/:repo", async (ctx, next) => { const input = { params: parseRequestInput(reposGetParamSchema, ctx.params), @@ -32968,15 +33851,7 @@ export function bootstrap( const { status, body } = await implementation.reposGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_full_repository], - ["301", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetResponseValidator(status, body) ctx.status = status return next() }) @@ -33032,6 +33907,17 @@ export function bootstrap( }) .optional() + const reposUpdateResponseValidator = responseValidationFactory( + [ + ["200", s_full_repository], + ["307", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch("reposUpdate", "/repos/:owner/:repo", async (ctx, next) => { const input = { params: parseRequestInput(reposUpdateParamSchema, ctx.params), @@ -33041,16 +33927,7 @@ export function bootstrap( const { status, body } = await implementation.reposUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_full_repository], - ["307", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposUpdateResponseValidator(status, body) ctx.status = status return next() }) @@ -33060,6 +33937,22 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposDeleteResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["307", s_basic_error], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.delete("reposDelete", "/repos/:owner/:repo", async (ctx, next) => { const input = { params: parseRequestInput(reposDeleteParamSchema, ctx.params), @@ -33069,21 +33962,7 @@ export function bootstrap( const { status, body } = await implementation.reposDelete(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["307", s_basic_error], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteResponseValidator(status, body) ctx.status = status return next() }) @@ -33099,6 +33978,42 @@ export function bootstrap( name: z.coerce.string().optional(), }) + const actionsListArtifactsForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListArtifactsForRepo", "/repos/:owner/:repo/actions/artifacts", @@ -33120,40 +34035,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - artifacts: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ - id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListArtifactsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -33165,6 +34047,11 @@ export function bootstrap( artifact_id: z.coerce.number(), }) + const actionsGetArtifactResponseValidator = responseValidationFactory( + [["200", s_artifact]], + undefined + ) + router.get( "actionsGetArtifact", "/repos/:owner/:repo/actions/artifacts/:artifactId", @@ -33180,10 +34067,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_artifact]], undefined)( - status, - body - ) + ctx.body = actionsGetArtifactResponseValidator(status, body) ctx.status = status return next() } @@ -33195,6 +34079,11 @@ export function bootstrap( artifact_id: z.coerce.number(), }) + const actionsDeleteArtifactResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "actionsDeleteArtifact", "/repos/:owner/:repo/actions/artifacts/:artifactId", @@ -33210,10 +34099,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteArtifactResponseValidator(status, body) ctx.status = status return next() } @@ -33226,6 +34112,14 @@ export function bootstrap( archive_format: z.coerce.string(), }) + const actionsDownloadArtifactResponseValidator = responseValidationFactory( + [ + ["302", z.void()], + ["410", s_basic_error], + ], + undefined + ) + router.get( "actionsDownloadArtifact", "/repos/:owner/:repo/actions/artifacts/:artifactId/:archiveFormat", @@ -33244,13 +34138,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["302", z.void()], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsDownloadArtifactResponseValidator(status, body) ctx.status = status return next() } @@ -33261,6 +34149,12 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsGetActionsCacheUsageResponseValidator = + responseValidationFactory( + [["200", s_actions_cache_usage_by_repository]], + undefined + ) + router.get( "actionsGetActionsCacheUsage", "/repos/:owner/:repo/actions/cache/usage", @@ -33279,10 +34173,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_cache_usage_by_repository]], - undefined - )(status, body) + ctx.body = actionsGetActionsCacheUsageResponseValidator(status, body) ctx.status = status return next() } @@ -33304,6 +34195,11 @@ export function bootstrap( direction: z.enum(["asc", "desc"]).optional(), }) + const actionsGetActionsCacheListResponseValidator = responseValidationFactory( + [["200", s_actions_cache_list]], + undefined + ) + router.get( "actionsGetActionsCacheList", "/repos/:owner/:repo/actions/caches", @@ -33325,10 +34221,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_cache_list]], - undefined - )(status, body) + ctx.body = actionsGetActionsCacheListResponseValidator(status, body) ctx.status = status return next() } @@ -33344,6 +34237,9 @@ export function bootstrap( ref: z.coerce.string().optional(), }) + const actionsDeleteActionsCacheByKeyResponseValidator = + responseValidationFactory([["200", s_actions_cache_list]], undefined) + router.delete( "actionsDeleteActionsCacheByKey", "/repos/:owner/:repo/actions/caches", @@ -33363,10 +34259,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteActionsCacheByKey(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_actions_cache_list]], - undefined - )(status, body) + ctx.body = actionsDeleteActionsCacheByKeyResponseValidator(status, body) ctx.status = status return next() } @@ -33378,6 +34271,9 @@ export function bootstrap( cache_id: z.coerce.number(), }) + const actionsDeleteActionsCacheByIdResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDeleteActionsCacheById", "/repos/:owner/:repo/actions/caches/:cacheId", @@ -33394,10 +34290,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteActionsCacheById(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteActionsCacheByIdResponseValidator(status, body) ctx.status = status return next() } @@ -33409,6 +34302,9 @@ export function bootstrap( job_id: z.coerce.number(), }) + const actionsGetJobForWorkflowRunResponseValidator = + responseValidationFactory([["200", s_job]], undefined) + router.get( "actionsGetJobForWorkflowRun", "/repos/:owner/:repo/actions/jobs/:jobId", @@ -33427,10 +34323,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_job]], undefined)( - status, - body - ) + ctx.body = actionsGetJobForWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -33442,6 +34335,9 @@ export function bootstrap( job_id: z.coerce.number(), }) + const actionsDownloadJobLogsForWorkflowRunResponseValidator = + responseValidationFactory([["302", z.void()]], undefined) + router.get( "actionsDownloadJobLogsForWorkflowRun", "/repos/:owner/:repo/actions/jobs/:jobId/logs", @@ -33458,7 +34354,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDownloadJobLogsForWorkflowRun(input, ctx) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + ctx.body = actionsDownloadJobLogsForWorkflowRunResponseValidator( status, body ) @@ -33477,6 +34373,15 @@ export function bootstrap( .object({ enable_debug_logging: z.coerce.boolean().optional() }) .optional() + const actionsReRunJobForWorkflowRunResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ], + undefined + ) + router.post( "actionsReRunJobForWorkflowRun", "/repos/:owner/:repo/actions/jobs/:jobId/rerun", @@ -33496,13 +34401,7 @@ export function bootstrap( const { status, body } = await implementation.actionsReRunJobForWorkflowRun(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsReRunJobForWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -33513,6 +34412,16 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsGetCustomOidcSubClaimForRepoResponseValidator = + responseValidationFactory( + [ + ["200", s_oidc_custom_sub_repo], + ["400", s_scim_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "actionsGetCustomOidcSubClaimForRepo", "/repos/:owner/:repo/actions/oidc/customization/sub", @@ -33529,14 +34438,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetCustomOidcSubClaimForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_oidc_custom_sub_repo], - ["400", s_scim_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsGetCustomOidcSubClaimForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33549,6 +34454,17 @@ export function bootstrap( const actionsSetCustomOidcSubClaimForRepoBodySchema = s_oidc_custom_sub_repo + const actionsSetCustomOidcSubClaimForRepoResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["400", s_scim_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "actionsSetCustomOidcSubClaimForRepo", "/repos/:owner/:repo/actions/oidc/customization/sub", @@ -33568,15 +34484,10 @@ export function bootstrap( const { status, body } = await implementation.actionsSetCustomOidcSubClaimForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["400", s_scim_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = actionsSetCustomOidcSubClaimForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33587,6 +34498,12 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsGetGithubActionsPermissionsRepositoryResponseValidator = + responseValidationFactory( + [["200", s_actions_repository_permissions]], + undefined + ) + router.get( "actionsGetGithubActionsPermissionsRepository", "/repos/:owner/:repo/actions/permissions", @@ -33606,10 +34523,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_repository_permissions]], - undefined - )(status, body) + ctx.body = actionsGetGithubActionsPermissionsRepositoryResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33625,6 +34542,9 @@ export function bootstrap( allowed_actions: z.enum(["all", "local_only", "selected"]).optional(), }) + const actionsSetGithubActionsPermissionsRepositoryResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetGithubActionsPermissionsRepository", "/repos/:owner/:repo/actions/permissions", @@ -33647,7 +34567,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetGithubActionsPermissionsRepositoryResponseValidator( status, body ) @@ -33661,6 +34581,12 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsGetWorkflowAccessToRepositoryResponseValidator = + responseValidationFactory( + [["200", s_actions_workflow_access_to_repository]], + undefined + ) + router.get( "actionsGetWorkflowAccessToRepository", "/repos/:owner/:repo/actions/permissions/access", @@ -33677,10 +34603,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetWorkflowAccessToRepository(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_actions_workflow_access_to_repository]], - undefined - )(status, body) + ctx.body = actionsGetWorkflowAccessToRepositoryResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33694,6 +34620,9 @@ export function bootstrap( const actionsSetWorkflowAccessToRepositoryBodySchema = s_actions_workflow_access_to_repository + const actionsSetWorkflowAccessToRepositoryResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetWorkflowAccessToRepository", "/repos/:owner/:repo/actions/permissions/access", @@ -33713,7 +34642,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetWorkflowAccessToRepository(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetWorkflowAccessToRepositoryResponseValidator( status, body ) @@ -33727,6 +34656,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsGetAllowedActionsRepositoryResponseValidator = + responseValidationFactory([["200", s_selected_actions]], undefined) + router.get( "actionsGetAllowedActionsRepository", "/repos/:owner/:repo/actions/permissions/selected-actions", @@ -33743,10 +34675,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetAllowedActionsRepository(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_selected_actions]], - undefined - )(status, body) + ctx.body = actionsGetAllowedActionsRepositoryResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33759,6 +34691,9 @@ export function bootstrap( const actionsSetAllowedActionsRepositoryBodySchema = s_selected_actions + const actionsSetAllowedActionsRepositoryResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "actionsSetAllowedActionsRepository", "/repos/:owner/:repo/actions/permissions/selected-actions", @@ -33778,7 +34713,7 @@ export function bootstrap( const { status, body } = await implementation.actionsSetAllowedActionsRepository(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsSetAllowedActionsRepositoryResponseValidator( status, body ) @@ -33790,6 +34725,12 @@ export function bootstrap( const actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string() }) + const actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryResponseValidator = + responseValidationFactory( + [["200", s_actions_get_default_workflow_permissions]], + undefined + ) + router.get( "actionsGetGithubActionsDefaultWorkflowPermissionsRepository", "/repos/:owner/:repo/actions/permissions/workflow", @@ -33809,10 +34750,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_get_default_workflow_permissions]], - undefined - )(status, body) + ctx.body = + actionsGetGithubActionsDefaultWorkflowPermissionsRepositoryResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33824,6 +34766,15 @@ export function bootstrap( const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryBodySchema = s_actions_set_default_workflow_permissions + const actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.put( "actionsSetGithubActionsDefaultWorkflowPermissionsRepository", "/repos/:owner/:repo/actions/permissions/workflow", @@ -33846,13 +34797,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = + actionsSetGithubActionsDefaultWorkflowPermissionsRepositoryResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -33893,494 +34842,497 @@ export function bootstrap( head_sha: z.coerce.string().optional(), }) - router.get( - "actionsListRequiredWorkflowRuns", - "/repos/:owner/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/runs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListRequiredWorkflowRunsParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListRequiredWorkflowRunsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsListRequiredWorkflowRuns(input, ctx) - - ctx.body = responseValidationFactory( + const actionsListRequiredWorkflowRunsResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( + "200", + z.object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }) .optional(), - triggering_actor: z + license: z .object({ + key: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), }) .optional(), - run_started_at: z.coerce + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce .string() .datetime({ offset: true }) .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }), - ], + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "actionsListRequiredWorkflowRuns", + "/repos/:owner/:repo/actions/required_workflows/:requiredWorkflowIdForRepo/runs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListRequiredWorkflowRunsParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListRequiredWorkflowRunsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListRequiredWorkflowRuns(input, ctx) + + ctx.body = actionsListRequiredWorkflowRunsResponseValidator(status, body) ctx.status = status return next() } @@ -34396,6 +35348,35 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListSelfHostedRunnersForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + runners: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + os: z.coerce.string(), + status: z.coerce.string(), + busy: z.coerce.boolean(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListSelfHostedRunnersForRepo", "/repos/:owner/:repo/actions/runners", @@ -34415,33 +35396,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListSelfHostedRunnersForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - runners: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - os: z.coerce.string(), - status: z.coerce.string(), - busy: z.coerce.boolean(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListSelfHostedRunnersForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34452,6 +35410,26 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsListRunnerApplicationsForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + os: z.coerce.string(), + architecture: z.coerce.string(), + download_url: z.coerce.string(), + filename: z.coerce.string(), + temp_download_token: z.coerce.string().optional(), + sha256_checksum: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "actionsListRunnerApplicationsForRepo", "/repos/:owner/:repo/actions/runners/downloads", @@ -34468,24 +35446,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListRunnerApplicationsForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - os: z.coerce.string(), - architecture: z.coerce.string(), - download_url: z.coerce.string(), - filename: z.coerce.string(), - temp_download_token: z.coerce.string().optional(), - sha256_checksum: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = actionsListRunnerApplicationsForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34496,6 +35460,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsCreateRegistrationTokenForRepoResponseValidator = + responseValidationFactory([["201", s_authentication_token]], undefined) + router.post( "actionsCreateRegistrationTokenForRepo", "/repos/:owner/:repo/actions/runners/registration-token", @@ -34512,10 +35479,10 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRegistrationTokenForRepo(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_authentication_token]], - undefined - )(status, body) + ctx.body = actionsCreateRegistrationTokenForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34526,6 +35493,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsCreateRemoveTokenForRepoResponseValidator = + responseValidationFactory([["201", s_authentication_token]], undefined) + router.post( "actionsCreateRemoveTokenForRepo", "/repos/:owner/:repo/actions/runners/remove-token", @@ -34542,10 +35512,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateRemoveTokenForRepo(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_authentication_token]], - undefined - )(status, body) + ctx.body = actionsCreateRemoveTokenForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -34557,6 +35524,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsGetSelfHostedRunnerForRepoResponseValidator = + responseValidationFactory([["200", s_runner]], undefined) + router.get( "actionsGetSelfHostedRunnerForRepo", "/repos/:owner/:repo/actions/runners/:runnerId", @@ -34573,7 +35543,7 @@ export function bootstrap( const { status, body } = await implementation.actionsGetSelfHostedRunnerForRepo(input, ctx) - ctx.body = responseValidationFactory([["200", s_runner]], undefined)( + ctx.body = actionsGetSelfHostedRunnerForRepoResponseValidator( status, body ) @@ -34588,6 +35558,9 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsDeleteSelfHostedRunnerFromRepoResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDeleteSelfHostedRunnerFromRepo", "/repos/:owner/:repo/actions/runners/:runnerId", @@ -34604,7 +35577,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteSelfHostedRunnerFromRepo(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = actionsDeleteSelfHostedRunnerFromRepoResponseValidator( status, body ) @@ -34619,6 +35592,27 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsListLabelsForSelfHostedRunnerForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "actionsListLabelsForSelfHostedRunnerForRepo", "/repos/:owner/:repo/actions/runners/:runnerId/labels", @@ -34638,25 +35632,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsListLabelsForSelfHostedRunnerForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34672,6 +35651,28 @@ export function bootstrap( labels: z.array(z.coerce.string()), }) + const actionsAddCustomLabelsToSelfHostedRunnerForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "actionsAddCustomLabelsToSelfHostedRunnerForRepo", "/repos/:owner/:repo/actions/runners/:runnerId/labels", @@ -34694,26 +35695,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + actionsAddCustomLabelsToSelfHostedRunnerForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34729,6 +35715,28 @@ export function bootstrap( labels: z.array(z.coerce.string()), }) + const actionsSetCustomLabelsForSelfHostedRunnerForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "actionsSetCustomLabelsForSelfHostedRunnerForRepo", "/repos/:owner/:repo/actions/runners/:runnerId/labels", @@ -34751,26 +35759,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + actionsSetCustomLabelsForSelfHostedRunnerForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34783,6 +35776,27 @@ export function bootstrap( runner_id: z.coerce.number(), }) + const actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo", "/repos/:owner/:repo/actions/runners/:runnerId/labels", @@ -34802,25 +35816,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34834,6 +35834,28 @@ export function bootstrap( name: z.coerce.string(), }) + const actionsRemoveCustomLabelFromSelfHostedRunnerForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + labels: z.array( + z.object({ + id: z.coerce.number().optional(), + name: z.coerce.string(), + type: z.enum(["read-only", "custom"]).optional(), + }) + ), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.delete( "actionsRemoveCustomLabelFromSelfHostedRunnerForRepo", "/repos/:owner/:repo/actions/runners/:runnerId/labels/:name", @@ -34853,26 +35875,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - name: z.coerce.string(), - type: z.enum(["read-only", "custom"]).optional(), - }) - ), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = + actionsRemoveCustomLabelFromSelfHostedRunnerForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -34912,494 +35919,497 @@ export function bootstrap( head_sha: z.coerce.string().optional(), }) - router.get( - "actionsListWorkflowRunsForRepo", - "/repos/:owner/:repo/actions/runs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListWorkflowRunsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - actionsListWorkflowRunsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.actionsListWorkflowRunsForRepo(input, ctx) - - ctx.body = responseValidationFactory( + const actionsListWorkflowRunsForRepoResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - workflow_runs: z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), - url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( + "200", + z.object({ + total_count: z.coerce.number(), + workflow_runs: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), }), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), }) .optional(), - triggering_actor: z + license: z .object({ + key: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), }) .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - repository: z.object({ + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }), - ], + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "actionsListWorkflowRunsForRepo", + "/repos/:owner/:repo/actions/runs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListWorkflowRunsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + actionsListWorkflowRunsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.actionsListWorkflowRunsForRepo(input, ctx) + + ctx.body = actionsListWorkflowRunsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -35415,6 +36425,11 @@ export function bootstrap( exclude_pull_requests: z.coerce.boolean().optional(), }) + const actionsGetWorkflowRunResponseValidator = responseValidationFactory( + [["200", s_workflow_run]], + undefined + ) + router.get( "actionsGetWorkflowRun", "/repos/:owner/:repo/actions/runs/:runId", @@ -35430,10 +36445,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_workflow_run]], - undefined - )(status, body) + ctx.body = actionsGetWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -35445,6 +36457,11 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsDeleteWorkflowRunResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "actionsDeleteWorkflowRun", "/repos/:owner/:repo/actions/runs/:runId", @@ -35463,10 +36480,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -35478,6 +36492,61 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsGetReviewsForRunResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + environments: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + state: z.enum(["approved", "rejected"]), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comment: z.coerce.string(), + }) + ), + ], + ], + undefined + ) + router.get( "actionsGetReviewsForRun", "/repos/:owner/:repo/actions/runs/:runId/approvals", @@ -35496,60 +36565,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - environments: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - state: z.enum(["approved", "rejected"]), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comment: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = actionsGetReviewsForRunResponseValidator(status, body) ctx.status = status return next() } @@ -35561,6 +36577,15 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsApproveWorkflowRunResponseValidator = responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "actionsApproveWorkflowRun", "/repos/:owner/:repo/actions/runs/:runId/approve", @@ -35579,14 +36604,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsApproveWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -35603,6 +36621,42 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListWorkflowRunArtifactsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + artifacts: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + size_in_bytes: z.coerce.number(), + url: z.coerce.string(), + archive_download_url: z.coerce.string(), + expired: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + workflow_run: z + .object({ + id: z.coerce.number().optional(), + repository_id: z.coerce.number().optional(), + head_repository_id: z.coerce.number().optional(), + head_branch: z.coerce.string().optional(), + head_sha: z.coerce.string().optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListWorkflowRunArtifacts", "/repos/:owner/:repo/actions/runs/:runId/artifacts", @@ -35622,40 +36676,7 @@ export function bootstrap( const { status, body } = await implementation.actionsListWorkflowRunArtifacts(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - artifacts: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - size_in_bytes: z.coerce.number(), - url: z.coerce.string(), - archive_download_url: z.coerce.string(), - expired: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - workflow_run: z - .object({ - id: z.coerce.number().optional(), - repository_id: z.coerce.number().optional(), - head_repository_id: z.coerce.number().optional(), - head_branch: z.coerce.string().optional(), - head_sha: z.coerce.string().optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListWorkflowRunArtifactsResponseValidator(status, body) ctx.status = status return next() } @@ -35672,6 +36693,9 @@ export function bootstrap( exclude_pull_requests: z.coerce.boolean().optional(), }) + const actionsGetWorkflowRunAttemptResponseValidator = + responseValidationFactory([["200", s_workflow_run]], undefined) + router.get( "actionsGetWorkflowRunAttempt", "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber", @@ -35691,10 +36715,7 @@ export function bootstrap( const { status, body } = await implementation.actionsGetWorkflowRunAttempt(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_workflow_run]], - undefined - )(status, body) + ctx.body = actionsGetWorkflowRunAttemptResponseValidator(status, body) ctx.status = status return next() } @@ -35712,6 +36733,71 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListJobsForWorkflowRunAttemptResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + jobs: z.array( + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "actionsListJobsForWorkflowRunAttempt", "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/jobs", @@ -35731,69 +36817,10 @@ export function bootstrap( const { status, body } = await implementation.actionsListJobsForWorkflowRunAttempt(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - jobs: z.array( - z.object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), - }) - ), - }), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsListJobsForWorkflowRunAttemptResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -35806,6 +36833,9 @@ export function bootstrap( attempt_number: z.coerce.number(), }) + const actionsDownloadWorkflowRunAttemptLogsResponseValidator = + responseValidationFactory([["302", z.void()]], undefined) + router.get( "actionsDownloadWorkflowRunAttemptLogs", "/repos/:owner/:repo/actions/runs/:runId/attempts/:attemptNumber/logs", @@ -35822,7 +36852,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDownloadWorkflowRunAttemptLogs(input, ctx) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( + ctx.body = actionsDownloadWorkflowRunAttemptLogsResponseValidator( status, body ) @@ -35837,6 +36867,14 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsCancelWorkflowRunResponseValidator = responseValidationFactory( + [ + ["202", s_empty_object], + ["409", s_basic_error], + ], + undefined + ) + router.post( "actionsCancelWorkflowRun", "/repos/:owner/:repo/actions/runs/:runId/cancel", @@ -35855,13 +36893,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["202", s_empty_object], - ["409", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsCancelWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -35879,9 +36911,73 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "actionsListJobsForWorkflowRun", - "/repos/:owner/:repo/actions/runs/:runId/jobs", + const actionsListJobsForWorkflowRunResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + jobs: z.array( + z.object({ + id: z.coerce.number(), + run_id: z.coerce.number(), + run_url: z.coerce.string(), + run_attempt: z.coerce.number().optional(), + node_id: z.coerce.string(), + head_sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + name: z.coerce.string(), + steps: z + .array( + z.object({ + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.coerce.string(), + name: z.coerce.string(), + number: z.coerce.number(), + started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + completed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ) + .optional(), + check_run_url: z.coerce.string(), + labels: z.array(z.coerce.string()), + runner_id: z.coerce.number(), + runner_name: z.coerce.string(), + runner_group_id: z.coerce.number(), + runner_group_name: z.coerce.string(), + workflow_name: z.coerce.string(), + head_branch: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + ) + + router.get( + "actionsListJobsForWorkflowRun", + "/repos/:owner/:repo/actions/runs/:runId/jobs", async (ctx, next) => { const input = { params: parseRequestInput( @@ -35898,68 +36994,7 @@ export function bootstrap( const { status, body } = await implementation.actionsListJobsForWorkflowRun(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - jobs: z.array( - z.object({ - id: z.coerce.number(), - run_id: z.coerce.number(), - run_url: z.coerce.string(), - run_attempt: z.coerce.number().optional(), - node_id: z.coerce.string(), - head_sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - name: z.coerce.string(), - steps: z - .array( - z.object({ - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.coerce.string(), - name: z.coerce.string(), - number: z.coerce.number(), - started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - completed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ) - .optional(), - check_run_url: z.coerce.string(), - labels: z.array(z.coerce.string()), - runner_id: z.coerce.number(), - runner_name: z.coerce.string(), - runner_group_id: z.coerce.number(), - runner_group_name: z.coerce.string(), - workflow_name: z.coerce.string(), - head_branch: z.coerce.string(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListJobsForWorkflowRunResponseValidator(status, body) ctx.status = status return next() } @@ -35971,6 +37006,9 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsDownloadWorkflowRunLogsResponseValidator = + responseValidationFactory([["302", z.void()]], undefined) + router.get( "actionsDownloadWorkflowRunLogs", "/repos/:owner/:repo/actions/runs/:runId/logs", @@ -35987,10 +37025,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDownloadWorkflowRunLogs(input, ctx) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDownloadWorkflowRunLogsResponseValidator(status, body) ctx.status = status return next() } @@ -36002,6 +37037,16 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsDeleteWorkflowRunLogsResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.delete( "actionsDeleteWorkflowRunLogs", "/repos/:owner/:repo/actions/runs/:runId/logs", @@ -36018,14 +37063,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteWorkflowRunLogs(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = actionsDeleteWorkflowRunLogsResponseValidator(status, body) ctx.status = status return next() } @@ -36037,6 +37075,38 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsGetPendingDeploymentsForRunResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + environment: z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }), + wait_timer: z.coerce.number(), + wait_timer_started_at: z.coerce + .string() + .datetime({ offset: true }), + current_user_can_approve: z.coerce.boolean(), + reviewers: z.array( + z.object({ + type: z.enum(["User", "Team"]).optional(), + reviewer: z.object({}).optional(), + }) + ), + }) + ), + ], + ], + undefined + ) + router.get( "actionsGetPendingDeploymentsForRun", "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", @@ -36053,36 +37123,10 @@ export function bootstrap( const { status, body } = await implementation.actionsGetPendingDeploymentsForRun(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - environment: z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }), - wait_timer: z.coerce.number(), - wait_timer_started_at: z.coerce - .string() - .datetime({ offset: true }), - current_user_can_approve: z.coerce.boolean(), - reviewers: z.array( - z.object({ - type: z.enum(["User", "Team"]).optional(), - reviewer: z.object({}).optional(), - }) - ), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = actionsGetPendingDeploymentsForRunResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -36100,6 +37144,108 @@ export function bootstrap( comment: z.coerce.string(), }) + const actionsReviewPendingDeploymentsForRunResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.post( "actionsReviewPendingDeploymentsForRun", "/repos/:owner/:repo/actions/runs/:runId/pending_deployments", @@ -36119,106 +37265,10 @@ export function bootstrap( const { status, body } = await implementation.actionsReviewPendingDeploymentsForRun(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = actionsReviewPendingDeploymentsForRunResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -36234,6 +37284,11 @@ export function bootstrap( .object({ enable_debug_logging: z.coerce.boolean().optional() }) .optional() + const actionsReRunWorkflowResponseValidator = responseValidationFactory( + [["201", s_empty_object]], + undefined + ) + router.post( "actionsReRunWorkflow", "/repos/:owner/:repo/actions/runs/:runId/rerun", @@ -36249,10 +37304,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_empty_object]], - undefined - )(status, body) + ctx.body = actionsReRunWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -36268,6 +37320,9 @@ export function bootstrap( .object({ enable_debug_logging: z.coerce.boolean().optional() }) .optional() + const actionsReRunWorkflowFailedJobsResponseValidator = + responseValidationFactory([["201", s_empty_object]], undefined) + router.post( "actionsReRunWorkflowFailedJobs", "/repos/:owner/:repo/actions/runs/:runId/rerun-failed-jobs", @@ -36287,10 +37342,7 @@ export function bootstrap( const { status, body } = await implementation.actionsReRunWorkflowFailedJobs(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_empty_object]], - undefined - )(status, body) + ctx.body = actionsReRunWorkflowFailedJobsResponseValidator(status, body) ctx.status = status return next() } @@ -36302,6 +37354,11 @@ export function bootstrap( run_id: z.coerce.number(), }) + const actionsGetWorkflowRunUsageResponseValidator = responseValidationFactory( + [["200", s_workflow_run_usage]], + undefined + ) + router.get( "actionsGetWorkflowRunUsage", "/repos/:owner/:repo/actions/runs/:runId/timing", @@ -36320,10 +37377,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_workflow_run_usage]], - undefined - )(status, body) + ctx.body = actionsGetWorkflowRunUsageResponseValidator(status, body) ctx.status = status return next() } @@ -36339,6 +37393,25 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListRepoSecretsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListRepoSecrets", "/repos/:owner/:repo/actions/secrets", @@ -36357,24 +37430,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListRepoSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -36385,6 +37441,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const actionsGetRepoPublicKeyResponseValidator = responseValidationFactory( + [["200", s_actions_public_key]], + undefined + ) + router.get( "actionsGetRepoPublicKey", "/repos/:owner/:repo/actions/secrets/public-key", @@ -36403,10 +37464,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_public_key]], - undefined - )(status, body) + ctx.body = actionsGetRepoPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -36418,6 +37476,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const actionsGetRepoSecretResponseValidator = responseValidationFactory( + [["200", s_actions_secret]], + undefined + ) + router.get( "actionsGetRepoSecret", "/repos/:owner/:repo/actions/secrets/:secretName", @@ -36433,10 +37496,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_secret]], - undefined - )(status, body) + ctx.body = actionsGetRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -36453,6 +37513,15 @@ export function bootstrap( key_id: z.coerce.string().optional(), }) + const actionsCreateOrUpdateRepoSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ], + undefined + ) + router.put( "actionsCreateOrUpdateRepoSecret", "/repos/:owner/:repo/actions/secrets/:secretName", @@ -36472,13 +37541,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateRepoSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsCreateOrUpdateRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -36490,6 +37553,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const actionsDeleteRepoSecretResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "actionsDeleteRepoSecret", "/repos/:owner/:repo/actions/secrets/:secretName", @@ -36508,10 +37576,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -36527,6 +37592,26 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListRepoVariablesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListRepoVariables", "/repos/:owner/:repo/actions/variables", @@ -36548,25 +37633,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListRepoVariablesResponseValidator(status, body) ctx.status = status return next() } @@ -36582,6 +37649,11 @@ export function bootstrap( value: z.coerce.string(), }) + const actionsCreateRepoVariableResponseValidator = responseValidationFactory( + [["201", s_empty_object]], + undefined + ) + router.post( "actionsCreateRepoVariable", "/repos/:owner/:repo/actions/variables", @@ -36600,10 +37672,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_empty_object]], - undefined - )(status, body) + ctx.body = actionsCreateRepoVariableResponseValidator(status, body) ctx.status = status return next() } @@ -36615,6 +37684,11 @@ export function bootstrap( name: z.coerce.string(), }) + const actionsGetRepoVariableResponseValidator = responseValidationFactory( + [["200", s_actions_variable]], + undefined + ) + router.get( "actionsGetRepoVariable", "/repos/:owner/:repo/actions/variables/:name", @@ -36633,10 +37707,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_variable]], - undefined - )(status, body) + ctx.body = actionsGetRepoVariableResponseValidator(status, body) ctx.status = status return next() } @@ -36653,6 +37724,11 @@ export function bootstrap( value: z.coerce.string().optional(), }) + const actionsUpdateRepoVariableResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.patch( "actionsUpdateRepoVariable", "/repos/:owner/:repo/actions/variables/:name", @@ -36671,10 +37747,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsUpdateRepoVariableResponseValidator(status, body) ctx.status = status return next() } @@ -36686,6 +37759,11 @@ export function bootstrap( name: z.coerce.string(), }) + const actionsDeleteRepoVariableResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "actionsDeleteRepoVariable", "/repos/:owner/:repo/actions/variables/:name", @@ -36704,10 +37782,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteRepoVariableResponseValidator(status, body) ctx.status = status return next() } @@ -36723,6 +37798,42 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListRepoWorkflowsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + workflows: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + path: z.coerce.string(), + state: z.enum([ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + html_url: z.coerce.string(), + badge_url: z.coerce.string(), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListRepoWorkflows", "/repos/:owner/:repo/actions/workflows", @@ -36744,41 +37855,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - workflows: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - path: z.coerce.string(), - state: z.enum([ - "active", - "deleted", - "disabled_fork", - "disabled_inactivity", - "disabled_manually", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - html_url: z.coerce.string(), - badge_url: z.coerce.string(), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListRepoWorkflowsResponseValidator(status, body) ctx.status = status return next() } @@ -36790,6 +37867,11 @@ export function bootstrap( workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) + const actionsGetWorkflowResponseValidator = responseValidationFactory( + [["200", s_workflow]], + undefined + ) + router.get( "actionsGetWorkflow", "/repos/:owner/:repo/actions/workflows/:workflowId", @@ -36805,10 +37887,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_workflow]], undefined)( - status, - body - ) + ctx.body = actionsGetWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -36820,6 +37899,11 @@ export function bootstrap( workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) + const actionsDisableWorkflowResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.put( "actionsDisableWorkflow", "/repos/:owner/:repo/actions/workflows/:workflowId/disable", @@ -36838,10 +37922,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDisableWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -36858,6 +37939,9 @@ export function bootstrap( inputs: z.object({}).optional(), }) + const actionsCreateWorkflowDispatchResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.post( "actionsCreateWorkflowDispatch", "/repos/:owner/:repo/actions/workflows/:workflowId/dispatches", @@ -36877,10 +37961,7 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateWorkflowDispatch(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsCreateWorkflowDispatchResponseValidator(status, body) ctx.status = status return next() } @@ -36892,6 +37973,11 @@ export function bootstrap( workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) + const actionsEnableWorkflowResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.put( "actionsEnableWorkflow", "/repos/:owner/:repo/actions/workflows/:workflowId/enable", @@ -36907,10 +37993,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsEnableWorkflowResponseValidator(status, body) ctx.status = status return next() } @@ -36951,493 +38034,495 @@ export function bootstrap( head_sha: z.coerce.string().optional(), }) - router.get( - "actionsListWorkflowRuns", - "/repos/:owner/:repo/actions/workflows/:workflowId/runs", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsListWorkflowRunsParamSchema, - ctx.params - ), - query: parseRequestInput(actionsListWorkflowRunsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.actionsListWorkflowRuns( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", + const actionsListWorkflowRunsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + workflow_runs: z.array( z.object({ - total_count: z.coerce.number(), - workflow_runs: z.array( + id: z.coerce.number(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + check_suite_id: z.coerce.number().optional(), + check_suite_node_id: z.coerce.string().optional(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + path: z.coerce.string(), + run_number: z.coerce.number(), + run_attempt: z.coerce.number().optional(), + referenced_workflows: z + .array( + z.object({ + path: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string().optional(), + }) + ) + .optional(), + event: z.coerce.string(), + status: z.coerce.string(), + conclusion: z.coerce.string(), + workflow_id: z.coerce.number(), + url: z.coerce.string(), + html_url: z.coerce.string(), + pull_requests: z.array( z.object({ id: z.coerce.number(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - check_suite_id: z.coerce.number().optional(), - check_suite_node_id: z.coerce.string().optional(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - path: z.coerce.string(), - run_number: z.coerce.number(), - run_attempt: z.coerce.number().optional(), - referenced_workflows: z - .array( - z.object({ - path: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string().optional(), - }) - ) - .optional(), - event: z.coerce.string(), - status: z.coerce.string(), - conclusion: z.coerce.string(), - workflow_id: z.coerce.number(), + number: z.coerce.number(), url: z.coerce.string(), - html_url: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - triggering_actor: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - run_started_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - jobs_url: z.coerce.string(), - logs_url: z.coerce.string(), - check_suite_url: z.coerce.string(), - artifacts_url: z.coerce.string(), - cancel_url: z.coerce.string(), - rerun_url: z.coerce.string(), - previous_attempt_url: z.coerce.string().optional(), - workflow_url: z.coerce.string(), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ name: z.coerce.string(), - email: z.coerce.string(), }), }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + name: z.coerce.string(), }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }), + }) + ), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + triggering_actor: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + run_started_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + jobs_url: z.coerce.string(), + logs_url: z.coerce.string(), + check_suite_url: z.coerce.string(), + artifacts_url: z.coerce.string(), + cancel_url: z.coerce.string(), + rerun_url: z.coerce.string(), + previous_attempt_url: z.coerce.string().optional(), + workflow_url: z.coerce.string(), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - license: z + secret_scanning: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + secret_scanning_push_protection: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - }), - head_repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + }) + .optional(), + }), + head_repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - license: z + secret_scanning: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + secret_scanning_push_protection: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - }), - head_repository_id: z.coerce.number().optional(), - display_title: z.coerce.string(), - }) - ), - }), - ], - ], - undefined - )(status, body) + }) + .optional(), + }), + head_repository_id: z.coerce.number().optional(), + display_title: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + ) + + router.get( + "actionsListWorkflowRuns", + "/repos/:owner/:repo/actions/workflows/:workflowId/runs", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsListWorkflowRunsParamSchema, + ctx.params + ), + query: parseRequestInput(actionsListWorkflowRunsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.actionsListWorkflowRuns( + input, + ctx + ) + + ctx.body = actionsListWorkflowRunsResponseValidator(status, body) ctx.status = status return next() } @@ -37449,6 +38534,11 @@ export function bootstrap( workflow_id: z.union([z.coerce.number(), z.coerce.string()]), }) + const actionsGetWorkflowUsageResponseValidator = responseValidationFactory( + [["200", s_workflow_usage]], + undefined + ) + router.get( "actionsGetWorkflowUsage", "/repos/:owner/:repo/actions/workflows/:workflowId/timing", @@ -37467,10 +38557,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_workflow_usage]], - undefined - )(status, body) + ctx.body = actionsGetWorkflowUsageResponseValidator(status, body) ctx.status = status return next() } @@ -37486,6 +38573,41 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListAssigneesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesListAssignees", "/repos/:owner/:repo/assignees", @@ -37501,40 +38623,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesListAssigneesResponseValidator(status, body) ctx.status = status return next() } @@ -37546,6 +38635,15 @@ export function bootstrap( assignee: z.coerce.string(), }) + const issuesCheckUserCanBeAssignedResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesCheckUserCanBeAssigned", "/repos/:owner/:repo/assignees/:assignee", @@ -37562,13 +38660,7 @@ export function bootstrap( const { status, body } = await implementation.issuesCheckUserCanBeAssigned(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesCheckUserCanBeAssignedResponseValidator(status, body) ctx.status = status return next() } @@ -37583,6 +38675,23 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListAutolinksResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + key_prefix: z.coerce.string(), + url_template: z.coerce.string(), + is_alphanumeric: z.coerce.boolean(), + }) + ), + ], + ], + undefined + ) + router.get( "reposListAutolinks", "/repos/:owner/:repo/autolinks", @@ -37598,22 +38707,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - key_prefix: z.coerce.string(), - url_template: z.coerce.string(), - is_alphanumeric: z.coerce.boolean(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListAutolinksResponseValidator(status, body) ctx.status = status return next() } @@ -37630,6 +38724,14 @@ export function bootstrap( is_alphanumeric: z.coerce.boolean().optional(), }) + const reposCreateAutolinkResponseValidator = responseValidationFactory( + [ + ["201", s_autolink], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateAutolink", "/repos/:owner/:repo/autolinks", @@ -37645,13 +38747,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_autolink], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateAutolinkResponseValidator(status, body) ctx.status = status return next() } @@ -37663,6 +38759,14 @@ export function bootstrap( autolink_id: z.coerce.number(), }) + const reposGetAutolinkResponseValidator = responseValidationFactory( + [ + ["200", s_autolink], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetAutolink", "/repos/:owner/:repo/autolinks/:autolinkId", @@ -37675,13 +38779,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetAutolink(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_autolink], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetAutolinkResponseValidator(status, body) ctx.status = status return next() } @@ -37693,6 +38791,14 @@ export function bootstrap( autolink_id: z.coerce.number(), }) + const reposDeleteAutolinkResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteAutolink", "/repos/:owner/:repo/autolinks/:autolinkId", @@ -37708,13 +38814,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteAutolinkResponseValidator(status, body) ctx.status = status return next() } @@ -37725,6 +38825,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposEnableAutomatedSecurityFixesResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "reposEnableAutomatedSecurityFixes", "/repos/:owner/:repo/automated-security-fixes", @@ -37741,7 +38844,7 @@ export function bootstrap( const { status, body } = await implementation.reposEnableAutomatedSecurityFixes(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = reposEnableAutomatedSecurityFixesResponseValidator( status, body ) @@ -37755,6 +38858,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposDisableAutomatedSecurityFixesResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reposDisableAutomatedSecurityFixes", "/repos/:owner/:repo/automated-security-fixes", @@ -37771,7 +38877,7 @@ export function bootstrap( const { status, body } = await implementation.reposDisableAutomatedSecurityFixes(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = reposDisableAutomatedSecurityFixesResponseValidator( status, body ) @@ -37791,468 +38897,460 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reposListBranches", - "/repos/:owner/:repo/branches", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListBranchesParamSchema, ctx.params), - query: parseRequestInput(reposListBranchesQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListBranches( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - protected: z.coerce.boolean(), - protection: z + const reposListBranchesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + protected: z.coerce.boolean(), + protection: z + .object({ + url: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + required_status_checks: z .object({ url: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - required_status_checks: z - .object({ - url: z.coerce.string().optional(), - enforcement_level: z.coerce.string().optional(), - contexts: z.array(z.coerce.string()), - checks: z.array( - z.object({ - context: z.coerce.string(), - app_id: z.coerce.number(), - }) - ), - contexts_url: z.coerce.string().optional(), - strict: z.coerce.boolean().optional(), + enforcement_level: z.coerce.string().optional(), + contexts: z.array(z.coerce.string()), + checks: z.array( + z.object({ + context: z.coerce.string(), + app_id: z.coerce.number(), }) - .optional(), - enforce_admins: z + ), + contexts_url: z.coerce.string().optional(), + strict: z.coerce.boolean().optional(), + }) + .optional(), + enforce_admins: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + required_pull_request_reviews: z + .object({ + url: z.coerce.string().optional(), + dismissal_restrictions: z .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) + .optional(), + url: z.coerce.string().optional(), + users_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), }) .optional(), - required_pull_request_reviews: z + bypass_pull_request_allowances: z .object({ - url: z.coerce.string().optional(), - dismissal_restrictions: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce - .number() - .optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ) - .optional(), - url: z.coerce.string().optional(), - users_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - }) + users: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) .optional(), - bypass_pull_request_allowances: z - .object({ - users: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - apps: z - .array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce - .number() - .optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), + teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), }) - ) - .optional(), - }) - .optional(), - dismiss_stale_reviews: z.coerce.boolean(), - require_code_owner_reviews: z.coerce.boolean(), - required_approving_review_count: z.coerce - .number() + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) .optional(), - require_last_push_approval: z.coerce - .boolean() + apps: z + .array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ) .optional(), }) .optional(), - restrictions: z - .object({ - url: z.coerce.string(), - users_url: z.coerce.string(), - teams_url: z.coerce.string(), - apps_url: z.coerce.string(), - users: z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - ), - teams: z.array( - z.object({ + dismiss_stale_reviews: z.coerce.boolean(), + require_code_owner_reviews: z.coerce.boolean(), + required_approving_review_count: z.coerce + .number() + .optional(), + require_last_push_approval: z.coerce.boolean().optional(), + }) + .optional(), + restrictions: z + .object({ + url: z.coerce.string(), + users_url: z.coerce.string(), + teams_url: z.coerce.string(), + apps_url: z.coerce.string(), + users: z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + ), + teams: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + slug: z.coerce.string().optional(), + description: z.coerce.string().optional(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string().optional(), + members_url: z.coerce.string().optional(), + repositories_url: z.coerce.string().optional(), + parent: z.coerce.string().optional(), + }) + ), + apps: z.array( + z.object({ + id: z.coerce.number().optional(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - slug: z.coerce.string().optional(), - description: z.coerce.string().optional(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), members_url: z.coerce.string().optional(), - repositories_url: z.coerce.string().optional(), - parent: z.coerce.string().optional(), - }) - ), - apps: z.array( - z.object({ - id: z.coerce.number().optional(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - members_url: z.coerce.string().optional(), - public_members_url: z.coerce - .string() - .optional(), - avatar_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - name: z.coerce.string().optional(), + public_members_url: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), description: z.coerce.string().optional(), - external_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), html_url: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - issues: z.coerce.string().optional(), - single_file: z.coerce.string().optional(), - }) - .optional(), - events: z.array(z.coerce.string()).optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) - ), - }) - .optional(), - required_linear_history: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_force_pushes: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_deletions: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - block_creations: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - required_conversation_resolution: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - name: z.coerce.string().optional(), - protection_url: z.coerce.string().optional(), - required_signatures: z - .object({ - url: z.coerce.string(), - enabled: z.coerce.boolean(), + .optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + external_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + issues: z.coerce.string().optional(), + single_file: z.coerce.string().optional(), + }) + .optional(), + events: z.array(z.coerce.string()).optional(), }) - .optional(), - lock_branch: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), - allow_fork_syncing: z - .object({ enabled: z.coerce.boolean().optional() }) - .optional(), + ), }) .optional(), + required_linear_history: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_force_pushes: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_deletions: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + block_creations: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + required_conversation_resolution: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + name: z.coerce.string().optional(), protection_url: z.coerce.string().optional(), + required_signatures: z + .object({ + url: z.coerce.string(), + enabled: z.coerce.boolean(), + }) + .optional(), + lock_branch: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), + allow_fork_syncing: z + .object({ enabled: z.coerce.boolean().optional() }) + .optional(), }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + .optional(), + protection_url: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "reposListBranches", + "/repos/:owner/:repo/branches", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListBranchesParamSchema, ctx.params), + query: parseRequestInput(reposListBranchesQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListBranches( + input, + ctx + ) + + ctx.body = reposListBranchesResponseValidator(status, body) ctx.status = status return next() } @@ -38264,6 +39362,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetBranchResponseValidator = responseValidationFactory( + [ + ["200", s_branch_with_protection], + ["301", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetBranch", "/repos/:owner/:repo/branches/:branch", @@ -38276,14 +39383,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetBranch(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_branch_with_protection], - ["301", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetBranchResponseValidator(status, body) ctx.status = status return next() } @@ -38295,6 +39395,14 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetBranchProtectionResponseValidator = responseValidationFactory( + [ + ["200", s_branch_protection], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetBranchProtection", "/repos/:owner/:repo/branches/:branch/protection", @@ -38313,13 +39421,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_branch_protection], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetBranchProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38379,6 +39481,17 @@ export function bootstrap( allow_fork_syncing: z.coerce.boolean().optional(), }) + const reposUpdateBranchProtectionResponseValidator = + responseValidationFactory( + [ + ["200", s_protected_branch], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "reposUpdateBranchProtection", "/repos/:owner/:repo/branches/:branch/protection", @@ -38400,15 +39513,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_protected_branch], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = reposUpdateBranchProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38420,6 +39525,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposDeleteBranchProtectionResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteBranchProtection", "/repos/:owner/:repo/branches/:branch/protection", @@ -38438,13 +39552,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteBranchProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38456,6 +39564,12 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetAdminBranchProtectionResponseValidator = + responseValidationFactory( + [["200", s_protected_branch_admin_enforced]], + undefined + ) + router.get( "reposGetAdminBranchProtection", "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", @@ -38472,10 +39586,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetAdminBranchProtection(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_protected_branch_admin_enforced]], - undefined - )(status, body) + ctx.body = reposGetAdminBranchProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38487,6 +39598,12 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposSetAdminBranchProtectionResponseValidator = + responseValidationFactory( + [["200", s_protected_branch_admin_enforced]], + undefined + ) + router.post( "reposSetAdminBranchProtection", "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", @@ -38503,10 +39620,7 @@ export function bootstrap( const { status, body } = await implementation.reposSetAdminBranchProtection(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_protected_branch_admin_enforced]], - undefined - )(status, body) + ctx.body = reposSetAdminBranchProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38518,6 +39632,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposDeleteAdminBranchProtectionResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteAdminBranchProtection", "/repos/:owner/:repo/branches/:branch/protection/enforce_admins", @@ -38534,13 +39657,7 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteAdminBranchProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteAdminBranchProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38552,6 +39669,12 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetPullRequestReviewProtectionResponseValidator = + responseValidationFactory( + [["200", s_protected_branch_pull_request_review]], + undefined + ) + router.get( "reposGetPullRequestReviewProtection", "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", @@ -38568,10 +39691,10 @@ export function bootstrap( const { status, body } = await implementation.reposGetPullRequestReviewProtection(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_protected_branch_pull_request_review]], - undefined - )(status, body) + ctx.body = reposGetPullRequestReviewProtectionResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -38606,6 +39729,15 @@ export function bootstrap( }) .optional() + const reposUpdatePullRequestReviewProtectionResponseValidator = + responseValidationFactory( + [ + ["200", s_protected_branch_pull_request_review], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "reposUpdatePullRequestReviewProtection", "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", @@ -38625,13 +39757,10 @@ export function bootstrap( const { status, body } = await implementation.reposUpdatePullRequestReviewProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_protected_branch_pull_request_review], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposUpdatePullRequestReviewProtectionResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -38643,6 +39772,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposDeletePullRequestReviewProtectionResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeletePullRequestReviewProtection", "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews", @@ -38659,13 +39797,10 @@ export function bootstrap( const { status, body } = await implementation.reposDeletePullRequestReviewProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeletePullRequestReviewProtectionResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -38677,6 +39812,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetCommitSignatureProtectionResponseValidator = + responseValidationFactory( + [ + ["200", s_protected_branch_admin_enforced], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetCommitSignatureProtection", "/repos/:owner/:repo/branches/:branch/protection/required_signatures", @@ -38693,13 +39837,10 @@ export function bootstrap( const { status, body } = await implementation.reposGetCommitSignatureProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_protected_branch_admin_enforced], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetCommitSignatureProtectionResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -38711,6 +39852,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposCreateCommitSignatureProtectionResponseValidator = + responseValidationFactory( + [ + ["200", s_protected_branch_admin_enforced], + ["404", s_basic_error], + ], + undefined + ) + router.post( "reposCreateCommitSignatureProtection", "/repos/:owner/:repo/branches/:branch/protection/required_signatures", @@ -38727,13 +39877,10 @@ export function bootstrap( const { status, body } = await implementation.reposCreateCommitSignatureProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_protected_branch_admin_enforced], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposCreateCommitSignatureProtectionResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -38745,6 +39892,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposDeleteCommitSignatureProtectionResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteCommitSignatureProtection", "/repos/:owner/:repo/branches/:branch/protection/required_signatures", @@ -38761,13 +39917,10 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteCommitSignatureProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteCommitSignatureProtectionResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -38779,6 +39932,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetStatusChecksProtectionResponseValidator = + responseValidationFactory( + [ + ["200", s_status_check_policy], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetStatusChecksProtection", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", @@ -38795,13 +39957,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetStatusChecksProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_status_check_policy], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetStatusChecksProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38828,6 +39984,16 @@ export function bootstrap( }) .optional() + const reposUpdateStatusCheckProtectionResponseValidator = + responseValidationFactory( + [ + ["200", s_status_check_policy], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "reposUpdateStatusCheckProtection", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", @@ -38847,14 +40013,7 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateStatusCheckProtection(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_status_check_policy], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposUpdateStatusCheckProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38866,6 +40025,9 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposRemoveStatusCheckProtectionResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reposRemoveStatusCheckProtection", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks", @@ -38882,10 +40044,7 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveStatusCheckProtection(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposRemoveStatusCheckProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -38897,6 +40056,15 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetAllStatusCheckContextsResponseValidator = + responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetAllStatusCheckContexts", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", @@ -38913,13 +40081,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetAllStatusCheckContexts(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetAllStatusCheckContextsResponseValidator(status, body) ctx.status = status return next() } @@ -38936,6 +40098,17 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposAddStatusCheckContextsResponseValidator = + responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposAddStatusCheckContexts", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", @@ -38957,15 +40130,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposAddStatusCheckContextsResponseValidator(status, body) ctx.status = status return next() } @@ -38982,6 +40147,16 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposSetStatusCheckContextsResponseValidator = + responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "reposSetStatusCheckContexts", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", @@ -39003,14 +40178,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposSetStatusCheckContextsResponseValidator(status, body) ctx.status = status return next() } @@ -39027,6 +40195,16 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposRemoveStatusCheckContextsResponseValidator = + responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "reposRemoveStatusCheckContexts", "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts", @@ -39046,14 +40224,7 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveStatusCheckContexts(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposRemoveStatusCheckContextsResponseValidator(status, body) ctx.status = status return next() } @@ -39065,6 +40236,14 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetAccessRestrictionsResponseValidator = responseValidationFactory( + [ + ["200", s_branch_restriction_policy], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions", @@ -39083,13 +40262,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_branch_restriction_policy], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39101,6 +40274,9 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposDeleteAccessRestrictionsResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reposDeleteAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions", @@ -39117,10 +40293,7 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDeleteAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39132,6 +40305,66 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetAppsWithAccessToProtectedBranchResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetAppsWithAccessToProtectedBranch", "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", @@ -39148,64 +40381,10 @@ export function bootstrap( const { status, body } = await implementation.reposGetAppsWithAccessToProtectedBranch(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetAppsWithAccessToProtectedBranchResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -39222,6 +40401,66 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposAddAppAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposAddAppAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", @@ -39241,64 +40480,7 @@ export function bootstrap( const { status, body } = await implementation.reposAddAppAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposAddAppAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39315,6 +40497,66 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposSetAppAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.put( "reposSetAppAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", @@ -39334,64 +40576,7 @@ export function bootstrap( const { status, body } = await implementation.reposSetAppAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposSetAppAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39408,6 +40593,66 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposRemoveAppAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "reposRemoveAppAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps", @@ -39427,64 +40672,7 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveAppAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposRemoveAppAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39496,6 +40684,55 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetTeamsWithAccessToProtectedBranchResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetTeamsWithAccessToProtectedBranch", "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", @@ -39515,68 +40752,74 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( + ctx.body = reposGetTeamsWithAccessToProtectedBranchResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposAddTeamAccessRestrictionsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + branch: z.coerce.string(), + }) + + const reposAddTeamAccessRestrictionsBodySchema = z.union([ + z.object({ teams: z.array(z.coerce.string()) }), + z.array(z.coerce.string()), + ]) + + const reposAddTeamAccessRestrictionsResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ id: z.coerce.number(), node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), name: z.coerce.string(), - slug: z.coerce.string(), description: z.coerce.string(), - privacy: z.coerce.string().optional(), permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - members_url: z.coerce.string(), repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["404", s_basic_error], + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposAddTeamAccessRestrictionsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - branch: z.coerce.string(), - }) - - const reposAddTeamAccessRestrictionsBodySchema = z.union([ - z.object({ teams: z.array(z.coerce.string()) }), - z.array(z.coerce.string()), - ]) + ["422", s_validation_error], + ], + undefined + ) router.post( "reposAddTeamAccessRestrictions", @@ -39597,53 +40840,7 @@ export function bootstrap( const { status, body } = await implementation.reposAddTeamAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposAddTeamAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39660,6 +40857,55 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposSetTeamAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.put( "reposSetTeamAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", @@ -39679,53 +40925,7 @@ export function bootstrap( const { status, body } = await implementation.reposSetTeamAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposSetTeamAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39742,6 +40942,55 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposRemoveTeamAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "reposRemoveTeamAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams", @@ -39761,53 +41010,10 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveTeamAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposRemoveTeamAccessRestrictionsResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -39819,6 +41025,42 @@ export function bootstrap( branch: z.coerce.string(), }) + const reposGetUsersWithAccessToProtectedBranchResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetUsersWithAccessToProtectedBranch", "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", @@ -39838,40 +41080,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetUsersWithAccessToProtectedBranchResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -39888,6 +41100,42 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposAddUserAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposAddUserAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", @@ -39907,40 +41155,7 @@ export function bootstrap( const { status, body } = await implementation.reposAddUserAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposAddUserAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -39957,6 +41172,42 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposSetUserAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.put( "reposSetUserAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", @@ -39976,40 +41227,7 @@ export function bootstrap( const { status, body } = await implementation.reposSetUserAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposSetUserAccessRestrictionsResponseValidator(status, body) ctx.status = status return next() } @@ -40026,6 +41244,42 @@ export function bootstrap( z.array(z.coerce.string()), ]) + const reposRemoveUserAccessRestrictionsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "reposRemoveUserAccessRestrictions", "/repos/:owner/:repo/branches/:branch/protection/restrictions/users", @@ -40045,40 +41299,10 @@ export function bootstrap( const { status, body } = await implementation.reposRemoveUserAccessRestrictions(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposRemoveUserAccessRestrictionsResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -40092,6 +41316,16 @@ export function bootstrap( const reposRenameBranchBodySchema = z.object({ new_name: z.coerce.string() }) + const reposRenameBranchResponseValidator = responseValidationFactory( + [ + ["201", s_branch_with_protection], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposRenameBranch", "/repos/:owner/:repo/branches/:branch/rename", @@ -40107,15 +41341,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_branch_with_protection], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposRenameBranchResponseValidator(status, body) ctx.status = status return next() } @@ -40131,6 +41357,11 @@ export function bootstrap( z.object({ status: z.object({}).optional() }), ]) + const checksCreateResponseValidator = responseValidationFactory( + [["201", s_check_run]], + undefined + ) + router.post( "checksCreate", "/repos/:owner/:repo/check-runs", @@ -40143,10 +41374,7 @@ export function bootstrap( const { status, body } = await implementation.checksCreate(input, ctx) - ctx.body = responseValidationFactory([["201", s_check_run]], undefined)( - status, - body - ) + ctx.body = checksCreateResponseValidator(status, body) ctx.status = status return next() } @@ -40158,6 +41386,11 @@ export function bootstrap( check_run_id: z.coerce.number(), }) + const checksGetResponseValidator = responseValidationFactory( + [["200", s_check_run]], + undefined + ) + router.get( "checksGet", "/repos/:owner/:repo/check-runs/:checkRunId", @@ -40170,10 +41403,7 @@ export function bootstrap( const { status, body } = await implementation.checksGet(input, ctx) - ctx.body = responseValidationFactory([["200", s_check_run]], undefined)( - status, - body - ) + ctx.body = checksGetResponseValidator(status, body) ctx.status = status return next() } @@ -40246,6 +41476,11 @@ export function bootstrap( .optional(), }) + const checksUpdateResponseValidator = responseValidationFactory( + [["200", s_check_run]], + undefined + ) + router.patch( "checksUpdate", "/repos/:owner/:repo/check-runs/:checkRunId", @@ -40258,10 +41493,7 @@ export function bootstrap( const { status, body } = await implementation.checksUpdate(input, ctx) - ctx.body = responseValidationFactory([["200", s_check_run]], undefined)( - status, - body - ) + ctx.body = checksUpdateResponseValidator(status, body) ctx.status = status return next() } @@ -40278,6 +41510,29 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const checksListAnnotationsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + path: z.coerce.string(), + start_line: z.coerce.number(), + end_line: z.coerce.number(), + start_column: z.coerce.number(), + end_column: z.coerce.number(), + annotation_level: z.coerce.string(), + title: z.coerce.string(), + message: z.coerce.string(), + raw_details: z.coerce.string(), + blob_href: z.coerce.string(), + }) + ), + ], + ], + undefined + ) + router.get( "checksListAnnotations", "/repos/:owner/:repo/check-runs/:checkRunId/annotations", @@ -40293,28 +41548,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - path: z.coerce.string(), - start_line: z.coerce.number(), - end_line: z.coerce.number(), - start_column: z.coerce.number(), - end_column: z.coerce.number(), - annotation_level: z.coerce.string(), - title: z.coerce.string(), - message: z.coerce.string(), - raw_details: z.coerce.string(), - blob_href: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = checksListAnnotationsResponseValidator(status, body) ctx.status = status return next() } @@ -40326,6 +41560,16 @@ export function bootstrap( check_run_id: z.coerce.number(), }) + const checksRerequestRunResponseValidator = responseValidationFactory( + [ + ["201", s_empty_object], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_basic_error], + ], + undefined + ) + router.post( "checksRerequestRun", "/repos/:owner/:repo/check-runs/:checkRunId/rerequest", @@ -40341,15 +41585,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_basic_error], - ], - undefined - )(status, body) + ctx.body = checksRerequestRunResponseValidator(status, body) ctx.status = status return next() } @@ -40362,6 +41598,14 @@ export function bootstrap( const checksCreateSuiteBodySchema = z.object({ head_sha: z.coerce.string() }) + const checksCreateSuiteResponseValidator = responseValidationFactory( + [ + ["200", s_check_suite], + ["201", s_check_suite], + ], + undefined + ) + router.post( "checksCreateSuite", "/repos/:owner/:repo/check-suites", @@ -40377,13 +41621,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_check_suite], - ["201", s_check_suite], - ], - undefined - )(status, body) + ctx.body = checksCreateSuiteResponseValidator(status, body) ctx.status = status return next() } @@ -40402,6 +41640,11 @@ export function bootstrap( .optional(), }) + const checksSetSuitesPreferencesResponseValidator = responseValidationFactory( + [["200", s_check_suite_preference]], + undefined + ) + router.patch( "checksSetSuitesPreferences", "/repos/:owner/:repo/check-suites/preferences", @@ -40420,10 +41663,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_check_suite_preference]], - undefined - )(status, body) + ctx.body = checksSetSuitesPreferencesResponseValidator(status, body) ctx.status = status return next() } @@ -40435,6 +41675,11 @@ export function bootstrap( check_suite_id: z.coerce.number(), }) + const checksGetSuiteResponseValidator = responseValidationFactory( + [["200", s_check_suite]], + undefined + ) + router.get( "checksGetSuite", "/repos/:owner/:repo/check-suites/:checkSuiteId", @@ -40447,10 +41692,7 @@ export function bootstrap( const { status, body } = await implementation.checksGetSuite(input, ctx) - ctx.body = responseValidationFactory([["200", s_check_suite]], undefined)( - status, - body - ) + ctx.body = checksGetSuiteResponseValidator(status, body) ctx.status = status return next() } @@ -40470,206 +41712,204 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "checksListForSuite", - "/repos/:owner/:repo/check-suites/:checkSuiteId/check-runs", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksListForSuiteParamSchema, ctx.params), - query: parseRequestInput(checksListForSuiteQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListForSuite( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", + const checksListForSuiteResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_runs: z.array( z.object({ - total_count: z.coerce.number(), - check_runs: z.array( - z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - head_sha: z.coerce.string(), node_id: z.coerce.string(), - external_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), + name: z.coerce.string(), }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), }), - pull_requests: z.array( - z.object({ + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ id: z.coerce.number(), - number: z.coerce.number(), url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z .object({ - url: z.coerce.string(), id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) .optional(), }) - ), - }), - ], - ], - undefined - )(status, body) + .optional(), + }) + ), + }), + ], + ], + undefined + ) + + router.get( + "checksListForSuite", + "/repos/:owner/:repo/check-suites/:checkSuiteId/check-runs", + async (ctx, next) => { + const input = { + params: parseRequestInput(checksListForSuiteParamSchema, ctx.params), + query: parseRequestInput(checksListForSuiteQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.checksListForSuite( + input, + ctx + ) + + ctx.body = checksListForSuiteResponseValidator(status, body) ctx.status = status return next() } @@ -40681,6 +41921,11 @@ export function bootstrap( check_suite_id: z.coerce.number(), }) + const checksRerequestSuiteResponseValidator = responseValidationFactory( + [["201", s_empty_object]], + undefined + ) + router.post( "checksRerequestSuite", "/repos/:owner/:repo/check-suites/:checkSuiteId/rerequest", @@ -40696,10 +41941,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_empty_object]], - undefined - )(status, body) + ctx.body = checksRerequestSuiteResponseValidator(status, body) ctx.status = status return next() } @@ -40724,6 +41966,113 @@ export function bootstrap( .optional(), }) + const codeScanningListAlertsForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + instances_url: z.coerce.string(), + state: z.enum(["open", "closed", "dismissed", "fixed"]), + fixed_at: z.coerce.string().datetime({ offset: true }).optional(), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_reason: z.enum([ + "null", + "false positive", + "won't fix", + "used in tests", + ]), + dismissed_comment: z.coerce.string().optional(), + rule: z.object({ + id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + tags: z.array(z.coerce.string()).optional(), + severity: z + .enum(["none", "note", "warning", "error"]) + .optional(), + description: z.coerce.string().optional(), + }), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + most_recent_instance: z.object({ + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }), + }) + ), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningListAlertsForRepo", "/repos/:owner/:repo/code-scanning/alerts", @@ -40743,114 +42092,7 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListAlertsForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - instances_url: z.coerce.string(), - state: z.enum(["open", "closed", "dismissed", "fixed"]), - fixed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_reason: z.enum([ - "null", - "false positive", - "won't fix", - "used in tests", - ]), - dismissed_comment: z.coerce.string().optional(), - rule: z.object({ - id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - tags: z.array(z.coerce.string()).optional(), - severity: z - .enum(["none", "note", "warning", "error"]) - .optional(), - description: z.coerce.string().optional(), - }), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - most_recent_instance: z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningListAlertsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -40862,6 +42104,24 @@ export function bootstrap( alert_number: z.coerce.number(), }) + const codeScanningGetAlertResponseValidator = responseValidationFactory( + [ + ["200", s_code_scanning_alert], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningGetAlert", "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", @@ -40877,23 +42137,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_code_scanning_alert], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningGetAlertResponseValidator(status, body) ctx.status = status return next() } @@ -40913,6 +42157,23 @@ export function bootstrap( dismissed_comment: z.coerce.string().optional(), }) + const codeScanningUpdateAlertResponseValidator = responseValidationFactory( + [ + ["200", s_code_scanning_alert], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.patch( "codeScanningUpdateAlert", "/repos/:owner/:repo/code-scanning/alerts/:alertNumber", @@ -40931,22 +42192,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_code_scanning_alert], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningUpdateAlertResponseValidator(status, body) ctx.status = status return next() } @@ -40964,71 +42210,74 @@ export function bootstrap( ref: z.coerce.string().optional(), }) - router.get( - "codeScanningListAlertInstances", - "/repos/:owner/:repo/code-scanning/alerts/:alertNumber/instances", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codeScanningListAlertInstancesParamSchema, - ctx.params - ), - query: parseRequestInput( - codeScanningListAlertInstancesQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codeScanningListAlertInstances(input, ctx) - - ctx.body = responseValidationFactory( + const codeScanningListAlertInstancesResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - ref: z.coerce.string().optional(), - analysis_key: z.coerce.string().optional(), - environment: z.coerce.string().optional(), - category: z.coerce.string().optional(), - state: z - .enum(["open", "closed", "dismissed", "fixed"]) - .optional(), - commit_sha: z.coerce.string().optional(), - message: z - .object({ text: z.coerce.string().optional() }) - .optional(), - location: z - .object({ - path: z.coerce.string().optional(), - start_line: z.coerce.number().optional(), - end_line: z.coerce.number().optional(), - start_column: z.coerce.number().optional(), - end_column: z.coerce.number().optional(), - }) - .optional(), - html_url: z.coerce.string().optional(), - classifications: z - .array(z.enum(["source", "generated", "test", "library"])) - .optional(), - }) - ), - ], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", + "200", + z.array( z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + ref: z.coerce.string().optional(), + analysis_key: z.coerce.string().optional(), + environment: z.coerce.string().optional(), + category: z.coerce.string().optional(), + state: z + .enum(["open", "closed", "dismissed", "fixed"]) + .optional(), + commit_sha: z.coerce.string().optional(), + message: z + .object({ text: z.coerce.string().optional() }) + .optional(), + location: z + .object({ + path: z.coerce.string().optional(), + start_line: z.coerce.number().optional(), + end_line: z.coerce.number().optional(), + start_column: z.coerce.number().optional(), + end_column: z.coerce.number().optional(), + }) + .optional(), + html_url: z.coerce.string().optional(), + classifications: z + .array(z.enum(["source", "generated", "test", "library"])) + .optional(), + }) + ), + ], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "codeScanningListAlertInstances", + "/repos/:owner/:repo/code-scanning/alerts/:alertNumber/instances", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codeScanningListAlertInstancesParamSchema, + ctx.params + ), + query: parseRequestInput( + codeScanningListAlertInstancesQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codeScanningListAlertInstances(input, ctx) + + ctx.body = codeScanningListAlertInstancesResponseValidator(status, body) ctx.status = status return next() } @@ -41050,6 +42299,49 @@ export function bootstrap( sort: z.enum(["created"]).optional(), }) + const codeScanningListRecentAnalysesResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref: z.coerce.string(), + commit_sha: z.coerce.string(), + analysis_key: z.coerce.string(), + environment: z.coerce.string(), + category: z.coerce.string().optional(), + error: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + results_count: z.coerce.number(), + rules_count: z.coerce.number(), + id: z.coerce.number(), + url: z.coerce.string(), + sarif_id: z.coerce.string(), + tool: z.object({ + name: z.coerce.string().optional(), + version: z.coerce.string().optional(), + guid: z.coerce.string().optional(), + }), + deletable: z.coerce.boolean(), + warning: z.coerce.string(), + }) + ), + ], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningListRecentAnalyses", "/repos/:owner/:repo/code-scanning/analyses", @@ -41069,47 +42361,7 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListRecentAnalyses(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref: z.coerce.string(), - commit_sha: z.coerce.string(), - analysis_key: z.coerce.string(), - environment: z.coerce.string(), - category: z.coerce.string().optional(), - error: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - results_count: z.coerce.number(), - rules_count: z.coerce.number(), - id: z.coerce.number(), - url: z.coerce.string(), - sarif_id: z.coerce.string(), - tool: z.object({ - name: z.coerce.string().optional(), - version: z.coerce.string().optional(), - guid: z.coerce.string().optional(), - }), - deletable: z.coerce.boolean(), - warning: z.coerce.string(), - }) - ), - ], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningListRecentAnalysesResponseValidator(status, body) ctx.status = status return next() } @@ -41121,6 +42373,23 @@ export function bootstrap( analysis_id: z.coerce.number(), }) + const codeScanningGetAnalysisResponseValidator = responseValidationFactory( + [ + ["200", z.object({})], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningGetAnalysis", "/repos/:owner/:repo/code-scanning/analyses/:analysisId", @@ -41139,22 +42408,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.object({})], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningGetAnalysisResponseValidator(status, body) ctx.status = status return next() } @@ -41170,6 +42424,24 @@ export function bootstrap( confirm_delete: z.coerce.string().optional(), }) + const codeScanningDeleteAnalysisResponseValidator = responseValidationFactory( + [ + ["200", s_code_scanning_analysis_deletion], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.delete( "codeScanningDeleteAnalysis", "/repos/:owner/:repo/code-scanning/analyses/:analysisId", @@ -41191,23 +42463,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_code_scanning_analysis_deletion], - ["400", s_scim_error], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningDeleteAnalysisResponseValidator(status, body) ctx.status = status return next() } @@ -41218,6 +42474,61 @@ export function bootstrap( repo: z.coerce.string(), }) + const codeScanningListCodeqlDatabasesResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + language: z.coerce.string(), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content_type: z.coerce.string(), + size: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + }) + ), + ], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningListCodeqlDatabases", "/repos/:owner/:repo/code-scanning/codeql/databases", @@ -41234,59 +42545,7 @@ export function bootstrap( const { status, body } = await implementation.codeScanningListCodeqlDatabases(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - language: z.coerce.string(), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content_type: z.coerce.string(), - size: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - }) - ), - ], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningListCodeqlDatabasesResponseValidator(status, body) ctx.status = status return next() } @@ -41298,6 +42557,25 @@ export function bootstrap( language: z.coerce.string(), }) + const codeScanningGetCodeqlDatabaseResponseValidator = + responseValidationFactory( + [ + ["200", s_code_scanning_codeql_database], + ["302", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningGetCodeqlDatabase", "/repos/:owner/:repo/code-scanning/codeql/databases/:language", @@ -41314,23 +42592,7 @@ export function bootstrap( const { status, body } = await implementation.codeScanningGetCodeqlDatabase(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_code_scanning_codeql_database], - ["302", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningGetCodeqlDatabaseResponseValidator(status, body) ctx.status = status return next() } @@ -41351,6 +42613,25 @@ export function bootstrap( validate: z.coerce.boolean().optional(), }) + const codeScanningUploadSarifResponseValidator = responseValidationFactory( + [ + ["202", s_code_scanning_sarifs_receipt], + ["400", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["413", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.post( "codeScanningUploadSarif", "/repos/:owner/:repo/code-scanning/sarifs", @@ -41369,24 +42650,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["202", s_code_scanning_sarifs_receipt], - ["400", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["413", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningUploadSarifResponseValidator(status, body) ctx.status = status return next() } @@ -41398,6 +42662,23 @@ export function bootstrap( sarif_id: z.coerce.string(), }) + const codeScanningGetSarifResponseValidator = responseValidationFactory( + [ + ["200", s_code_scanning_sarifs_status], + ["403", s_basic_error], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "codeScanningGetSarif", "/repos/:owner/:repo/code-scanning/sarifs/:sarifId", @@ -41413,22 +42694,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_code_scanning_sarifs_status], - ["403", s_basic_error], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codeScanningGetSarifResponseValidator(status, body) ctx.status = status return next() } @@ -41443,6 +42709,14 @@ export function bootstrap( ref: z.coerce.string().optional(), }) + const reposCodeownersErrorsResponseValidator = responseValidationFactory( + [ + ["200", s_codeowners_errors], + ["404", z.void()], + ], + undefined + ) + router.get( "reposCodeownersErrors", "/repos/:owner/:repo/codeowners/errors", @@ -41458,13 +42732,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_codeowners_errors], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = reposCodeownersErrorsResponseValidator(status, body) ctx.status = status return next() } @@ -41480,40 +42748,70 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "codespacesListInRepositoryForAuthenticatedUser", - "/repos/:owner/:repo/codespaces", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesListInRepositoryForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - codespacesListInRepositoryForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesListInRepositoryForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const codespacesListInRepositoryForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ id: z.coerce.number(), + node_id: z.coerce.string(), name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), + full_name: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -41537,279 +42835,254 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), + body: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), - url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), - pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), }) .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce - .string() + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) .optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce - .string() - .datetime({ offset: true }) + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }), ], - undefined - )(status, body) + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + + router.get( + "codespacesListInRepositoryForAuthenticatedUser", + "/repos/:owner/:repo/codespaces", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesListInRepositoryForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + codespacesListInRepositoryForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesListInRepositoryForAuthenticatedUser( + input, + ctx + ) + + ctx.body = + codespacesListInRepositoryForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -41833,6 +43106,27 @@ export function bootstrap( retention_period_minutes: z.coerce.number().optional(), }) + const codespacesCreateWithRepoForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_codespace], + ["202", s_codespace], + ["400", s_scim_error], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.post( "codespacesCreateWithRepoForAuthenticatedUser", "/repos/:owner/:repo/codespaces", @@ -41855,25 +43149,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_codespace], - ["202", s_codespace], - ["400", s_scim_error], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codespacesCreateWithRepoForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -41888,6 +43167,30 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const codespacesListDevcontainersInRepositoryForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + devcontainers: z.array( + z.object({ + path: z.coerce.string(), + name: z.coerce.string().optional(), + }) + ), + }), + ], + ["400", s_scim_error], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.get( "codespacesListDevcontainersInRepositoryForAuthenticatedUser", "/repos/:owner/:repo/codespaces/devcontainers", @@ -41910,28 +43213,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - devcontainers: z.array( - z.object({ - path: z.coerce.string(), - name: z.coerce.string().optional(), - }) - ), - }), - ], - ["400", s_scim_error], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesListDevcontainersInRepositoryForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -41947,6 +43233,35 @@ export function bootstrap( client_ip: z.coerce.string().optional(), }) + const codespacesRepoMachinesForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + machines: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }) + ), + }), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.get( "codespacesRepoMachinesForAuthenticatedUser", "/repos/:owner/:repo/codespaces/machines", @@ -41969,37 +43284,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - machines: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }) - ), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesRepoMachinesForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -42015,6 +43303,52 @@ export function bootstrap( client_ip: z.coerce.string().optional(), }) + const codespacesPreFlightWithRepoForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + billable_owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + defaults: z + .object({ + location: z.coerce.string(), + devcontainer_path: z.coerce.string(), + }) + .optional(), + }), + ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "codespacesPreFlightWithRepoForAuthenticatedUser", "/repos/:owner/:repo/codespaces/new", @@ -42037,50 +43371,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - billable_owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - defaults: z - .object({ - location: z.coerce.string(), - devcontainer_path: z.coerce.string(), - }) - .optional(), - }), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesPreFlightWithRepoForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -42096,6 +43391,25 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const codespacesListRepoSecretsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "codespacesListRepoSecrets", "/repos/:owner/:repo/codespaces/secrets", @@ -42117,24 +43431,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = codespacesListRepoSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -42145,6 +43442,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const codespacesGetRepoPublicKeyResponseValidator = responseValidationFactory( + [["200", s_codespaces_public_key]], + undefined + ) + router.get( "codespacesGetRepoPublicKey", "/repos/:owner/:repo/codespaces/secrets/public-key", @@ -42163,10 +43465,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_codespaces_public_key]], - undefined - )(status, body) + ctx.body = codespacesGetRepoPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -42178,6 +43477,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const codespacesGetRepoSecretResponseValidator = responseValidationFactory( + [["200", s_repo_codespaces_secret]], + undefined + ) + router.get( "codespacesGetRepoSecret", "/repos/:owner/:repo/codespaces/secrets/:secretName", @@ -42196,10 +43500,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_repo_codespaces_secret]], - undefined - )(status, body) + ctx.body = codespacesGetRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -42216,6 +43517,15 @@ export function bootstrap( key_id: z.coerce.string().optional(), }) + const codespacesCreateOrUpdateRepoSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ], + undefined + ) + router.put( "codespacesCreateOrUpdateRepoSecret", "/repos/:owner/:repo/codespaces/secrets/:secretName", @@ -42235,13 +43545,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateOrUpdateRepoSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = codespacesCreateOrUpdateRepoSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -42253,6 +43560,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const codespacesDeleteRepoSecretResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "codespacesDeleteRepoSecret", "/repos/:owner/:repo/codespaces/secrets/:secretName", @@ -42271,10 +43583,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = codespacesDeleteRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -42294,6 +43603,50 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListCollaboratorsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + admin: z.coerce.boolean(), + }) + .optional(), + role_name: z.coerce.string(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposListCollaborators", "/repos/:owner/:repo/collaborators", @@ -42312,49 +43665,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - admin: z.coerce.boolean(), - }) - .optional(), - role_name: z.coerce.string(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposListCollaboratorsResponseValidator(status, body) ctx.status = status return next() } @@ -42366,6 +43677,14 @@ export function bootstrap( username: z.coerce.string(), }) + const reposCheckCollaboratorResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "reposCheckCollaborator", "/repos/:owner/:repo/collaborators/:username", @@ -42384,13 +43703,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = reposCheckCollaboratorResponseValidator(status, body) ctx.status = status return next() } @@ -42406,6 +43719,16 @@ export function bootstrap( .object({ permission: z.coerce.string().optional() }) .optional() + const reposAddCollaboratorResponseValidator = responseValidationFactory( + [ + ["201", s_repository_invitation], + ["204", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "reposAddCollaborator", "/repos/:owner/:repo/collaborators/:username", @@ -42421,15 +43744,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_repository_invitation], - ["204", z.void()], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposAddCollaboratorResponseValidator(status, body) ctx.status = status return next() } @@ -42441,6 +43756,11 @@ export function bootstrap( username: z.coerce.string(), }) + const reposRemoveCollaboratorResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposRemoveCollaborator", "/repos/:owner/:repo/collaborators/:username", @@ -42459,10 +43779,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposRemoveCollaboratorResponseValidator(status, body) ctx.status = status return next() } @@ -42474,6 +43791,15 @@ export function bootstrap( username: z.coerce.string(), }) + const reposGetCollaboratorPermissionLevelResponseValidator = + responseValidationFactory( + [ + ["200", s_repository_collaborator_permission], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetCollaboratorPermissionLevel", "/repos/:owner/:repo/collaborators/:username/permission", @@ -42490,13 +43816,10 @@ export function bootstrap( const { status, body } = await implementation.reposGetCollaboratorPermissionLevel(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_repository_collaborator_permission], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetCollaboratorPermissionLevelResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -42512,95 +43835,98 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reposListCommitCommentsForRepo", - "/repos/:owner/:repo/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommitCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommitCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListCommitCommentsForRepo(input, ctx) - - ctx.body = responseValidationFactory( + const reposListCommitCommentsForRepoResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), + "200", + z.array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "reposListCommitCommentsForRepo", + "/repos/:owner/:repo/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCommitCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommitCommentsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListCommitCommentsForRepo(input, ctx) + + ctx.body = reposListCommitCommentsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -42612,6 +43938,14 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const reposGetCommitCommentResponseValidator = responseValidationFactory( + [ + ["200", s_commit_comment], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetCommitComment", "/repos/:owner/:repo/comments/:commentId", @@ -42627,13 +43961,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_commit_comment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -42649,6 +43977,14 @@ export function bootstrap( body: z.coerce.string(), }) + const reposUpdateCommitCommentResponseValidator = responseValidationFactory( + [ + ["200", s_commit_comment], + ["404", s_basic_error], + ], + undefined + ) + router.patch( "reposUpdateCommitComment", "/repos/:owner/:repo/comments/:commentId", @@ -42667,13 +44003,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_commit_comment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposUpdateCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -42685,6 +44015,14 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const reposDeleteCommitCommentResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteCommitComment", "/repos/:owner/:repo/comments/:commentId", @@ -42703,13 +44041,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -42738,6 +44070,57 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForCommitCommentResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reactionsListForCommitComment", "/repos/:owner/:repo/comments/:commentId/reactions", @@ -42757,55 +44140,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForCommitComment(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reactionsListForCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -42830,6 +44165,16 @@ export function bootstrap( ]), }) + const reactionsCreateForCommitCommentResponseValidator = + responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reactionsCreateForCommitComment", "/repos/:owner/:repo/comments/:commentId/reactions", @@ -42849,14 +44194,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForCommitComment(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -42869,6 +44207,9 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForCommitCommentResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reactionsDeleteForCommitComment", "/repos/:owner/:repo/comments/:commentId/reactions/:reactionId", @@ -42885,10 +44226,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForCommitComment(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reactionsDeleteForCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -42909,6 +44247,140 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListCommitsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ), + ], + ["400", s_scim_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.get( "reposListCommits", "/repos/:owner/:repo/commits", @@ -42921,139 +44393,7 @@ export function bootstrap( const { status, body } = await implementation.reposListCommits(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - ), - ], - ["400", s_scim_error], - ["404", s_basic_error], - ["409", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposListCommitsResponseValidator(status, body) ctx.status = status return next() } @@ -43065,6 +44405,27 @@ export function bootstrap( commit_sha: z.coerce.string(), }) + const reposListBranchesForHeadCommitResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + protected: z.coerce.boolean(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.get( "reposListBranchesForHeadCommit", "/repos/:owner/:repo/commits/:commitSha/branches-where-head", @@ -43081,25 +44442,7 @@ export function bootstrap( const { status, body } = await implementation.reposListBranchesForHeadCommit(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - protected: z.coerce.boolean(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposListBranchesForHeadCommitResponseValidator(status, body) ctx.status = status return next() } @@ -43116,6 +44459,77 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListCommentsForCommitResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + html_url: z.coerce.string(), + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + body: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + line: z.coerce.number(), + commit_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "reposListCommentsForCommit", "/repos/:owner/:repo/commits/:commitSha/comments", @@ -43137,76 +44551,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - html_url: z.coerce.string(), - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - body: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - line: z.coerce.number(), - commit_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListCommentsForCommitResponseValidator(status, body) ctx.status = status return next() } @@ -43225,6 +44570,15 @@ export function bootstrap( line: z.coerce.number().optional(), }) + const reposCreateCommitCommentResponseValidator = responseValidationFactory( + [ + ["201", s_commit_comment], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateCommitComment", "/repos/:owner/:repo/commits/:commitSha/comments", @@ -43243,14 +44597,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_commit_comment], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateCommitCommentResponseValidator(status, body) ctx.status = status return next() } @@ -43267,51 +44614,75 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reposListPullRequestsAssociatedWithCommit", - "/repos/:owner/:repo/commits/:commitSha/pulls", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListPullRequestsAssociatedWithCommitParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListPullRequestsAssociatedWithCommitQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListPullRequestsAssociatedWithCommit( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const reposListPullRequestsAssociatedWithCommitResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -43334,29 +44705,72 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - body: z.coerce.string(), - labels: z.array( + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + ) + .optional(), + requested_reviewers: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -43378,189 +44792,67 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), permissions: z .object({ - admin: z.coerce.boolean(), pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), + triage: z.coerce.boolean(), push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), }) .optional(), - owner: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -43582,314 +44874,312 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), received_events_url: z.coerce.string(), type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -43911,998 +45201,484 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), - }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), received_events_url: z.coerce.string(), type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), - }), - draft: z.coerce.boolean().optional(), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposGetCommitParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const reposGetCommitQuerySchema = z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - }) - - router.get( - "reposGetCommit", - "/repos/:owner/:repo/commits/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposGetCommitParamSchema, ctx.params), - query: parseRequestInput(reposGetCommitQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposGetCommit(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", s_commit], - ["404", s_basic_error], - ["422", s_validation_error], - ["500", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksListForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const checksListForRefQuerySchema = z.object({ - check_name: z.coerce.string().optional(), - status: z.enum(["queued", "in_progress", "completed"]).optional(), - filter: z.enum(["latest", "all"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - app_id: z.coerce.number().optional(), - }) - - router.get( - "checksListForRef", - "/repos/:owner/:repo/commits/:ref/check-runs", - async (ctx, next) => { - const input = { - params: parseRequestInput(checksListForRefParamSchema, ctx.params), - query: parseRequestInput(checksListForRefQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.checksListForRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - check_runs: z.array( - z.object({ - id: z.coerce.number(), - head_sha: z.coerce.string(), - node_id: z.coerce.string(), - external_id: z.coerce.string(), - url: z.coerce.string(), + private: z.coerce.boolean(), html_url: z.coerce.string(), - details_url: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - ]), - started_at: z.coerce.string().datetime({ offset: true }), - completed_at: z.coerce.string().datetime({ offset: true }), - output: z.object({ - title: z.coerce.string(), - summary: z.coerce.string(), - text: z.coerce.string(), - annotations_count: z.coerce.number(), - annotations_url: z.coerce.string(), - }), - name: z.coerce.string(), - check_suite: z.object({ id: z.coerce.number() }), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - deployment: z + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - task: z.coerce.string(), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const checksListSuitesForRefParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - ref: z.coerce.string(), - }) - - const checksListSuitesForRefQuerySchema = z.object({ - app_id: z.coerce.number().optional(), - check_name: z.coerce.string().optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ), + ], + ], + undefined + ) router.get( - "checksListSuitesForRef", - "/repos/:owner/:repo/commits/:ref/check-suites", + "reposListPullRequestsAssociatedWithCommit", + "/repos/:owner/:repo/commits/:commitSha/pulls", async (ctx, next) => { const input = { params: parseRequestInput( - checksListSuitesForRefParamSchema, + reposListPullRequestsAssociatedWithCommitParamSchema, ctx.params ), - query: parseRequestInput(checksListSuitesForRefQuerySchema, ctx.query), + query: parseRequestInput( + reposListPullRequestsAssociatedWithCommitQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.checksListSuitesForRef( - input, - ctx - ) + const { status, body } = + await implementation.reposListPullRequestsAssociatedWithCommit( + input, + ctx + ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - check_suites: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - head_branch: z.coerce.string(), - head_sha: z.coerce.string(), - status: z.enum(["queued", "in_progress", "completed"]), - conclusion: z.enum([ - "success", - "failure", - "neutral", - "cancelled", - "skipped", - "timed_out", - "action_required", - "startup_failure", - "stale", - "null", - ]), - url: z.coerce.string(), - before: z.coerce.string(), - after: z.coerce.string(), - pull_requests: z.array( - z.object({ - id: z.coerce.number(), - number: z.coerce.number(), - url: z.coerce.string(), - head: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - base: z.object({ - ref: z.coerce.string(), - sha: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - url: z.coerce.string(), - name: z.coerce.string(), - }), - }), - }) - ), - app: z.object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - head_commit: z.object({ - id: z.coerce.string(), - tree_id: z.coerce.string(), - message: z.coerce.string(), - timestamp: z.coerce.string().datetime({ offset: true }), - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - committer: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - }), - }), - latest_check_runs_count: z.coerce.number(), - check_runs_url: z.coerce.string(), - rerequestable: z.coerce.boolean().optional(), - runs_rerequestable: z.coerce.boolean().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = reposListPullRequestsAssociatedWithCommitResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const reposGetCombinedStatusForRefParamSchema = z.object({ + const reposGetCommitParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), ref: z.coerce.string(), }) - const reposGetCombinedStatusForRefQuerySchema = z.object({ - per_page: z.coerce.number().optional(), + const reposGetCommitQuerySchema = z.object({ page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), }) + const reposGetCommitResponseValidator = responseValidationFactory( + [ + ["200", s_commit], + ["404", s_basic_error], + ["422", s_validation_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( - "reposGetCombinedStatusForRef", - "/repos/:owner/:repo/commits/:ref/status", + "reposGetCommit", + "/repos/:owner/:repo/commits/:ref", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetCombinedStatusForRefParamSchema, - ctx.params - ), - query: parseRequestInput( - reposGetCombinedStatusForRefQuerySchema, - ctx.query - ), + params: parseRequestInput(reposGetCommitParamSchema, ctx.params), + query: parseRequestInput(reposGetCommitQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposGetCombinedStatusForRef(input, ctx) + const { status, body } = await implementation.reposGetCommit(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_combined_commit_status], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetCommitResponseValidator(status, body) ctx.status = status return next() } ) - const reposListCommitStatusesForRefParamSchema = z.object({ + const checksListForRefParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), ref: z.coerce.string(), }) - const reposListCommitStatusesForRefQuerySchema = z.object({ + const checksListForRefQuerySchema = z.object({ + check_name: z.coerce.string().optional(), + status: z.enum(["queued", "in_progress", "completed"]).optional(), + filter: z.enum(["latest", "all"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), + app_id: z.coerce.number().optional(), }) - router.get( - "reposListCommitStatusesForRef", - "/repos/:owner/:repo/commits/:ref/statuses", - async (ctx, next) => { - const input = { - params: parseRequestInput( - reposListCommitStatusesForRefParamSchema, - ctx.params - ), - query: parseRequestInput( - reposListCommitStatusesForRefQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.reposListCommitStatusesForRef(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - avatar_url: z.coerce.string(), + const checksListForRefResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_runs: z.array( + z.object({ + id: z.coerce.number(), + head_sha: z.coerce.string(), + node_id: z.coerce.string(), + external_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + details_url: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + ]), + started_at: z.coerce.string().datetime({ offset: true }), + completed_at: z.coerce.string().datetime({ offset: true }), + output: z.object({ + title: z.coerce.string(), + summary: z.coerce.string(), + text: z.coerce.string(), + annotations_count: z.coerce.number(), + annotations_url: z.coerce.string(), + }), + name: z.coerce.string(), + check_suite: z.object({ id: z.coerce.number() }), + app: z.object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - state: z.coerce.string(), - description: z.coerce.string(), - target_url: z.coerce.string(), - context: z.coerce.string(), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -44925,165 +45701,762 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - }) - ), - ], - ["301", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + deployment: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + task: z.coerce.string(), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), + ], + ], + undefined ) - const reposGetCommunityProfileMetricsParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - router.get( - "reposGetCommunityProfileMetrics", - "/repos/:owner/:repo/community/profile", + "checksListForRef", + "/repos/:owner/:repo/commits/:ref/check-runs", async (ctx, next) => { const input = { - params: parseRequestInput( - reposGetCommunityProfileMetricsParamSchema, - ctx.params - ), - query: undefined, + params: parseRequestInput(checksListForRefParamSchema, ctx.params), + query: parseRequestInput(checksListForRefQuerySchema, ctx.query), body: undefined, } - const { status, body } = - await implementation.reposGetCommunityProfileMetrics(input, ctx) + const { status, body } = await implementation.checksListForRef(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_community_profile]], - undefined - )(status, body) + ctx.body = checksListForRefResponseValidator(status, body) ctx.status = status return next() } ) - const reposCompareCommitsParamSchema = z.object({ + const checksListSuitesForRefParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - basehead: z.coerce.string(), + ref: z.coerce.string(), }) - const reposCompareCommitsQuerySchema = z.object({ - page: z.coerce.number().optional(), + const checksListSuitesForRefQuerySchema = z.object({ + app_id: z.coerce.number().optional(), + check_name: z.coerce.string().optional(), per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) + const checksListSuitesForRefResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + check_suites: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + head_branch: z.coerce.string(), + head_sha: z.coerce.string(), + status: z.enum(["queued", "in_progress", "completed"]), + conclusion: z.enum([ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required", + "startup_failure", + "stale", + "null", + ]), + url: z.coerce.string(), + before: z.coerce.string(), + after: z.coerce.string(), + pull_requests: z.array( + z.object({ + id: z.coerce.number(), + number: z.coerce.number(), + url: z.coerce.string(), + head: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + base: z.object({ + ref: z.coerce.string(), + sha: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + url: z.coerce.string(), + name: z.coerce.string(), + }), + }), + }) + ), + app: z.object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + head_commit: z.object({ + id: z.coerce.string(), + tree_id: z.coerce.string(), + message: z.coerce.string(), + timestamp: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + committer: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + }), + }), + latest_check_runs_count: z.coerce.number(), + check_runs_url: z.coerce.string(), + rerequestable: z.coerce.boolean().optional(), + runs_rerequestable: z.coerce.boolean().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( - "reposCompareCommits", - "/repos/:owner/:repo/compare/:basehead", + "checksListSuitesForRef", + "/repos/:owner/:repo/commits/:ref/check-suites", async (ctx, next) => { const input = { - params: parseRequestInput(reposCompareCommitsParamSchema, ctx.params), - query: parseRequestInput(reposCompareCommitsQuerySchema, ctx.query), + params: parseRequestInput( + checksListSuitesForRefParamSchema, + ctx.params + ), + query: parseRequestInput(checksListSuitesForRefQuerySchema, ctx.query), body: undefined, } - const { status, body } = await implementation.reposCompareCommits( + const { status, body } = await implementation.checksListSuitesForRef( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_commit_comparison], - ["404", s_basic_error], - ["500", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = checksListSuitesForRefResponseValidator(status, body) ctx.status = status return next() } ) - const reposGetContentParamSchema = z.object({ + const reposGetCombinedStatusForRefParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - path: z.coerce.string(), + ref: z.coerce.string(), }) - const reposGetContentQuerySchema = z.object({ - ref: z.coerce.string().optional(), + const reposGetCombinedStatusForRefQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) + const reposGetCombinedStatusForRefResponseValidator = + responseValidationFactory( + [ + ["200", s_combined_commit_status], + ["404", s_basic_error], + ], + undefined + ) + router.get( - "reposGetContent", - "/repos/:owner/:repo/contents/:path", + "reposGetCombinedStatusForRef", + "/repos/:owner/:repo/commits/:ref/status", async (ctx, next) => { const input = { - params: parseRequestInput(reposGetContentParamSchema, ctx.params), - query: parseRequestInput(reposGetContentQuerySchema, ctx.query), + params: parseRequestInput( + reposGetCombinedStatusForRefParamSchema, + ctx.params + ), + query: parseRequestInput( + reposGetCombinedStatusForRefQuerySchema, + ctx.query + ), body: undefined, } - const { status, body } = await implementation.reposGetContent(input, ctx) + const { status, body } = + await implementation.reposGetCombinedStatusForRef(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.union([ - s_content_directory, - s_content_file, - s_content_symlink, - s_content_submodule, - ]), - ], - ["302", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetCombinedStatusForRefResponseValidator(status, body) ctx.status = status return next() } ) - const reposCreateOrUpdateFileContentsParamSchema = z.object({ + const reposListCommitStatusesForRefParamSchema = z.object({ owner: z.coerce.string(), repo: z.coerce.string(), - path: z.coerce.string(), + ref: z.coerce.string(), }) - const reposCreateOrUpdateFileContentsBodySchema = z.object({ - message: z.coerce.string(), - content: z.coerce.string(), - sha: z.coerce.string().optional(), - branch: z.coerce.string().optional(), - committer: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().optional(), - }) - .optional(), - author: z - .object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().optional(), - }) - .optional(), - }) + const reposListCommitStatusesForRefQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const reposListCommitStatusesForRefResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + avatar_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.coerce.string(), + description: z.coerce.string(), + target_url: z.coerce.string(), + context: z.coerce.string(), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + ], + ["301", s_basic_error], + ], + undefined + ) + + router.get( + "reposListCommitStatusesForRef", + "/repos/:owner/:repo/commits/:ref/statuses", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposListCommitStatusesForRefParamSchema, + ctx.params + ), + query: parseRequestInput( + reposListCommitStatusesForRefQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListCommitStatusesForRef(input, ctx) + + ctx.body = reposListCommitStatusesForRefResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposGetCommunityProfileMetricsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const reposGetCommunityProfileMetricsResponseValidator = + responseValidationFactory([["200", s_community_profile]], undefined) + + router.get( + "reposGetCommunityProfileMetrics", + "/repos/:owner/:repo/community/profile", + async (ctx, next) => { + const input = { + params: parseRequestInput( + reposGetCommunityProfileMetricsParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.reposGetCommunityProfileMetrics(input, ctx) + + ctx.body = reposGetCommunityProfileMetricsResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposCompareCommitsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + basehead: z.coerce.string(), + }) + + const reposCompareCommitsQuerySchema = z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + const reposCompareCommitsResponseValidator = responseValidationFactory( + [ + ["200", s_commit_comparison], + ["404", s_basic_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + + router.get( + "reposCompareCommits", + "/repos/:owner/:repo/compare/:basehead", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposCompareCommitsParamSchema, ctx.params), + query: parseRequestInput(reposCompareCommitsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposCompareCommits( + input, + ctx + ) + + ctx.body = reposCompareCommitsResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposGetContentParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + path: z.coerce.string(), + }) + + const reposGetContentQuerySchema = z.object({ + ref: z.coerce.string().optional(), + }) + + const reposGetContentResponseValidator = responseValidationFactory( + [ + [ + "200", + z.union([ + s_content_directory, + s_content_file, + s_content_symlink, + s_content_submodule, + ]), + ], + ["302", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "reposGetContent", + "/repos/:owner/:repo/contents/:path", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposGetContentParamSchema, ctx.params), + query: parseRequestInput(reposGetContentQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposGetContent(input, ctx) + + ctx.body = reposGetContentResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateOrUpdateFileContentsParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + path: z.coerce.string(), + }) + + const reposCreateOrUpdateFileContentsBodySchema = z.object({ + message: z.coerce.string(), + content: z.coerce.string(), + sha: z.coerce.string().optional(), + branch: z.coerce.string().optional(), + committer: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().optional(), + }) + .optional(), + author: z + .object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().optional(), + }) + .optional(), + }) + + const reposCreateOrUpdateFileContentsResponseValidator = + responseValidationFactory( + [ + ["200", s_file_commit], + ["201", s_file_commit], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) router.put( "reposCreateOrUpdateFileContents", @@ -45104,16 +46477,7 @@ export function bootstrap( const { status, body } = await implementation.reposCreateOrUpdateFileContents(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_file_commit], - ["201", s_file_commit], - ["404", s_basic_error], - ["409", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateOrUpdateFileContentsResponseValidator(status, body) ctx.status = status return next() } @@ -45143,6 +46507,24 @@ export function bootstrap( .optional(), }) + const reposDeleteFileResponseValidator = responseValidationFactory( + [ + ["200", s_file_commit], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.delete( "reposDeleteFile", "/repos/:owner/:repo/contents/:path", @@ -45155,23 +46537,7 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteFile(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_file_commit], - ["404", s_basic_error], - ["409", s_basic_error], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = reposDeleteFileResponseValidator(status, body) ctx.status = status return next() } @@ -45188,6 +46554,43 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListContributorsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string(), + site_admin: z.coerce.boolean().optional(), + contributions: z.coerce.number(), + email: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ), + ], + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposListContributors", "/repos/:owner/:repo/contributors", @@ -45203,42 +46606,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string(), - site_admin: z.coerce.boolean().optional(), - contributions: z.coerce.number(), - email: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - ), - ], - ["204", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposListContributorsResponseValidator(status, body) ctx.status = status return next() } @@ -45266,6 +46634,125 @@ export function bootstrap( last: z.coerce.number().optional(), }) + const dependabotListAlertsForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number(), + state: z.enum(["dismissed", "fixed", "open"]), + dependency: z.object({ + package: z + .object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }) + .optional(), + manifest_path: z.coerce.string().optional(), + scope: z.enum(["development", "runtime"]).optional(), + }), + security_advisory: z.object({ + ghsa_id: z.coerce.string(), + cve_id: z.coerce.string(), + summary: z.coerce.string(), + description: z.coerce.string(), + vulnerabilities: z.array( + z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }) + ), + severity: z.enum(["low", "medium", "high", "critical"]), + cvss: z.object({ + score: z.coerce.number(), + vector_string: z.coerce.string(), + }), + cwes: z.array( + z.object({ + cwe_id: z.coerce.string(), + name: z.coerce.string(), + }) + ), + identifiers: z.array( + z.object({ + type: z.enum(["CVE", "GHSA"]), + value: z.coerce.string(), + }) + ), + references: z.array(z.object({ url: z.coerce.string() })), + published_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + withdrawn_at: z.coerce.string().datetime({ offset: true }), + }), + security_vulnerability: z.object({ + package: z.object({ + ecosystem: z.coerce.string(), + name: z.coerce.string(), + }), + severity: z.enum(["low", "medium", "high", "critical"]), + vulnerable_version_range: z.coerce.string(), + first_patched_version: z.object({ + identifier: z.coerce.string(), + }), + }), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + dismissed_at: z.coerce.string().datetime({ offset: true }), + dismissed_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + dismissed_reason: z.enum([ + "fix_started", + "inaccurate", + "no_bandwidth", + "not_used", + "tolerable_risk", + ]), + dismissed_comment: z.coerce.string(), + fixed_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.get( "dependabotListAlertsForRepo", "/repos/:owner/:repo/dependabot/alerts", @@ -45287,123 +46774,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number(), - state: z.enum(["dismissed", "fixed", "open"]), - dependency: z.object({ - package: z - .object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }) - .optional(), - manifest_path: z.coerce.string().optional(), - scope: z.enum(["development", "runtime"]).optional(), - }), - security_advisory: z.object({ - ghsa_id: z.coerce.string(), - cve_id: z.coerce.string(), - summary: z.coerce.string(), - description: z.coerce.string(), - vulnerabilities: z.array( - z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }) - ), - severity: z.enum(["low", "medium", "high", "critical"]), - cvss: z.object({ - score: z.coerce.number(), - vector_string: z.coerce.string(), - }), - cwes: z.array( - z.object({ - cwe_id: z.coerce.string(), - name: z.coerce.string(), - }) - ), - identifiers: z.array( - z.object({ - type: z.enum(["CVE", "GHSA"]), - value: z.coerce.string(), - }) - ), - references: z.array(z.object({ url: z.coerce.string() })), - published_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - withdrawn_at: z.coerce.string().datetime({ offset: true }), - }), - security_vulnerability: z.object({ - package: z.object({ - ecosystem: z.coerce.string(), - name: z.coerce.string(), - }), - severity: z.enum(["low", "medium", "high", "critical"]), - vulnerable_version_range: z.coerce.string(), - first_patched_version: z.object({ - identifier: z.coerce.string(), - }), - }), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - dismissed_at: z.coerce.string().datetime({ offset: true }), - dismissed_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - dismissed_reason: z.enum([ - "fix_started", - "inaccurate", - "no_bandwidth", - "not_used", - "tolerable_risk", - ]), - dismissed_comment: z.coerce.string(), - fixed_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["304", z.void()], - ["400", s_scim_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = dependabotListAlertsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -45415,6 +46786,16 @@ export function bootstrap( alert_number: z.coerce.number(), }) + const dependabotGetAlertResponseValidator = responseValidationFactory( + [ + ["200", s_dependabot_alert], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "dependabotGetAlert", "/repos/:owner/:repo/dependabot/alerts/:alertNumber", @@ -45430,15 +46811,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_dependabot_alert], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = dependabotGetAlertResponseValidator(status, body) ctx.status = status return next() } @@ -45464,6 +46837,18 @@ export function bootstrap( dismissed_comment: z.coerce.string().optional(), }) + const dependabotUpdateAlertResponseValidator = responseValidationFactory( + [ + ["200", s_dependabot_alert], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.patch( "dependabotUpdateAlert", "/repos/:owner/:repo/dependabot/alerts/:alertNumber", @@ -45479,17 +46864,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_dependabot_alert], - ["400", s_scim_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["409", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = dependabotUpdateAlertResponseValidator(status, body) ctx.status = status return next() } @@ -45505,6 +46880,25 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const dependabotListRepoSecretsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "dependabotListRepoSecrets", "/repos/:owner/:repo/dependabot/secrets", @@ -45526,24 +46920,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = dependabotListRepoSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -45554,6 +46931,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const dependabotGetRepoPublicKeyResponseValidator = responseValidationFactory( + [["200", s_dependabot_public_key]], + undefined + ) + router.get( "dependabotGetRepoPublicKey", "/repos/:owner/:repo/dependabot/secrets/public-key", @@ -45572,10 +46954,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_dependabot_public_key]], - undefined - )(status, body) + ctx.body = dependabotGetRepoPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -45587,6 +46966,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const dependabotGetRepoSecretResponseValidator = responseValidationFactory( + [["200", s_dependabot_secret]], + undefined + ) + router.get( "dependabotGetRepoSecret", "/repos/:owner/:repo/dependabot/secrets/:secretName", @@ -45605,10 +46989,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_dependabot_secret]], - undefined - )(status, body) + ctx.body = dependabotGetRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -45625,6 +47006,15 @@ export function bootstrap( key_id: z.coerce.string().optional(), }) + const dependabotCreateOrUpdateRepoSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ], + undefined + ) + router.put( "dependabotCreateOrUpdateRepoSecret", "/repos/:owner/:repo/dependabot/secrets/:secretName", @@ -45644,13 +47034,10 @@ export function bootstrap( const { status, body } = await implementation.dependabotCreateOrUpdateRepoSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = dependabotCreateOrUpdateRepoSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -45662,6 +47049,11 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const dependabotDeleteRepoSecretResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "dependabotDeleteRepoSecret", "/repos/:owner/:repo/dependabot/secrets/:secretName", @@ -45680,10 +47072,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = dependabotDeleteRepoSecretResponseValidator(status, body) ctx.status = status return next() } @@ -45699,6 +47088,15 @@ export function bootstrap( name: z.coerce.string().optional(), }) + const dependencyGraphDiffRangeResponseValidator = responseValidationFactory( + [ + ["200", s_dependency_graph_diff], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "dependencyGraphDiffRange", "/repos/:owner/:repo/dependency-graph/compare/:basehead", @@ -45720,14 +47118,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_dependency_graph_diff], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = dependencyGraphDiffRangeResponseValidator(status, body) ctx.status = status return next() } @@ -45740,6 +47131,22 @@ export function bootstrap( const dependencyGraphCreateRepositorySnapshotBodySchema = s_snapshot + const dependencyGraphCreateRepositorySnapshotResponseValidator = + responseValidationFactory( + [ + [ + "201", + z.object({ + id: z.coerce.number(), + created_at: z.coerce.string(), + result: z.coerce.string(), + message: z.coerce.string(), + }), + ], + ], + undefined + ) + router.post( "dependencyGraphCreateRepositorySnapshot", "/repos/:owner/:repo/dependency-graph/snapshots", @@ -45759,20 +47166,10 @@ export function bootstrap( const { status, body } = await implementation.dependencyGraphCreateRepositorySnapshot(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "201", - z.object({ - id: z.coerce.number(), - created_at: z.coerce.string(), - result: z.coerce.string(), - message: z.coerce.string(), - }), - ], - ], - undefined - )(status, body) + ctx.body = dependencyGraphCreateRepositorySnapshotResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -45792,38 +47189,57 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reposListDeployments", - "/repos/:owner/:repo/deployments", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListDeploymentsParamSchema, ctx.params), - query: parseRequestInput(reposListDeploymentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListDeployments( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), + const reposListDeploymentsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + sha: z.coerce.string(), + ref: z.coerce.string(), + task: z.coerce.string(), + payload: z.union([z.object({}), z.coerce.string()]), + original_environment: z.coerce.string().optional(), + environment: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + statuses_url: z.coerce.string(), + repository_url: z.coerce.string(), + transient_environment: z.coerce.boolean().optional(), + production_environment: z.coerce.boolean().optional(), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - sha: z.coerce.string(), - ref: z.coerce.string(), - task: z.coerce.string(), - payload: z.union([z.object({}), z.coerce.string()]), - original_environment: z.coerce.string().optional(), - environment: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -45846,67 +47262,50 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - statuses_url: z.coerce.string(), - repository_url: z.coerce.string(), - transient_environment: z.coerce.boolean().optional(), - production_environment: z.coerce.boolean().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ), - ], - ], - undefined - )(status, body) + .optional(), + }) + ), + ], + ], + undefined + ) + + router.get( + "reposListDeployments", + "/repos/:owner/:repo/deployments", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListDeploymentsParamSchema, ctx.params), + query: parseRequestInput(reposListDeploymentsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListDeployments( + input, + ctx + ) + + ctx.body = reposListDeploymentsResponseValidator(status, body) ctx.status = status return next() } @@ -45929,6 +47328,16 @@ export function bootstrap( production_environment: z.coerce.boolean().optional(), }) + const reposCreateDeploymentResponseValidator = responseValidationFactory( + [ + ["201", s_deployment], + ["202", z.object({ message: z.coerce.string().optional() })], + ["409", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateDeployment", "/repos/:owner/:repo/deployments", @@ -45944,15 +47353,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_deployment], - ["202", z.object({ message: z.coerce.string().optional() })], - ["409", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateDeploymentResponseValidator(status, body) ctx.status = status return next() } @@ -45964,6 +47365,14 @@ export function bootstrap( deployment_id: z.coerce.number(), }) + const reposGetDeploymentResponseValidator = responseValidationFactory( + [ + ["200", s_deployment], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetDeployment", "/repos/:owner/:repo/deployments/:deploymentId", @@ -45979,13 +47388,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_deployment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetDeploymentResponseValidator(status, body) ctx.status = status return next() } @@ -45997,6 +47400,15 @@ export function bootstrap( deployment_id: z.coerce.number(), }) + const reposDeleteDeploymentResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.delete( "reposDeleteDeployment", "/repos/:owner/:repo/deployments/:deploymentId", @@ -46012,14 +47424,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = reposDeleteDeploymentResponseValidator(status, body) ctx.status = status return next() } @@ -46036,6 +47441,114 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListDeploymentStatusesResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + state: z.enum([ + "error", + "failure", + "inactive", + "pending", + "success", + "queued", + "in_progress", + ]), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + description: z.coerce.string(), + environment: z.coerce.string().optional(), + target_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deployment_url: z.coerce.string(), + repository_url: z.coerce.string(), + environment_url: z.coerce.string().optional(), + log_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposListDeploymentStatuses", "/repos/:owner/:repo/deployments/:deploymentId/statuses", @@ -46057,112 +47570,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - state: z.enum([ - "error", - "failure", - "inactive", - "pending", - "success", - "queued", - "in_progress", - ]), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - description: z.coerce.string(), - environment: z.coerce.string().optional(), - target_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deployment_url: z.coerce.string(), - repository_url: z.coerce.string(), - environment_url: z.coerce.string().optional(), - log_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposListDeploymentStatusesResponseValidator(status, body) ctx.status = status return next() } @@ -46192,6 +47600,15 @@ export function bootstrap( auto_inactive: z.coerce.boolean().optional(), }) + const reposCreateDeploymentStatusResponseValidator = + responseValidationFactory( + [ + ["201", s_deployment_status], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateDeploymentStatus", "/repos/:owner/:repo/deployments/:deploymentId/statuses", @@ -46213,13 +47630,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_deployment_status], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateDeploymentStatusResponseValidator(status, body) ctx.status = status return next() } @@ -46232,6 +47643,14 @@ export function bootstrap( status_id: z.coerce.number(), }) + const reposGetDeploymentStatusResponseValidator = responseValidationFactory( + [ + ["200", s_deployment_status], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetDeploymentStatus", "/repos/:owner/:repo/deployments/:deploymentId/statuses/:statusId", @@ -46250,13 +47669,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_deployment_status], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetDeploymentStatusResponseValidator(status, body) ctx.status = status return next() } @@ -46272,6 +47685,14 @@ export function bootstrap( client_payload: z.object({}).optional(), }) + const reposCreateDispatchEventResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateDispatchEvent", "/repos/:owner/:repo/dispatches", @@ -46290,13 +47711,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateDispatchEventResponseValidator(status, body) ctx.status = status return next() } @@ -46312,6 +47727,38 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposGetAllEnvironmentsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number().optional(), + environments: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + protection_rules: z.array(z.object({})).optional(), + deployment_branch_policy: z + .object({ + protected_branches: z.coerce.boolean(), + custom_branch_policies: z.coerce.boolean(), + }) + .optional(), + }) + ) + .optional(), + }), + ], + ], + undefined + ) + router.get( "reposGetAllEnvironments", "/repos/:owner/:repo/environments", @@ -46330,37 +47777,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number().optional(), - environments: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - protection_rules: z.array(z.object({})).optional(), - deployment_branch_policy: z - .object({ - protected_branches: z.coerce.boolean(), - custom_branch_policies: z.coerce.boolean(), - }) - .optional(), - }) - ) - .optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = reposGetAllEnvironmentsResponseValidator(status, body) ctx.status = status return next() } @@ -46372,6 +47789,11 @@ export function bootstrap( environment_name: z.coerce.string(), }) + const reposGetEnvironmentResponseValidator = responseValidationFactory( + [["200", s_environment]], + undefined + ) + router.get( "reposGetEnvironment", "/repos/:owner/:repo/environments/:environmentName", @@ -46387,10 +47809,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_environment]], undefined)( - status, - body - ) + ctx.body = reposGetEnvironmentResponseValidator(status, body) ctx.status = status return next() } @@ -46422,6 +47841,15 @@ export function bootstrap( }) .optional() + const reposCreateOrUpdateEnvironmentResponseValidator = + responseValidationFactory( + [ + ["200", s_environment], + ["422", s_basic_error], + ], + undefined + ) + router.put( "reposCreateOrUpdateEnvironment", "/repos/:owner/:repo/environments/:environmentName", @@ -46441,13 +47869,7 @@ export function bootstrap( const { status, body } = await implementation.reposCreateOrUpdateEnvironment(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_environment], - ["422", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposCreateOrUpdateEnvironmentResponseValidator(status, body) ctx.status = status return next() } @@ -46459,6 +47881,11 @@ export function bootstrap( environment_name: z.coerce.string(), }) + const reposDeleteAnEnvironmentResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposDeleteAnEnvironment", "/repos/:owner/:repo/environments/:environmentName", @@ -46477,10 +47904,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDeleteAnEnvironmentResponseValidator(status, body) ctx.status = status return next() } @@ -46497,6 +47921,26 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListDeploymentBranchPoliciesResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + branch_policies: z.array( + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "reposListDeploymentBranchPolicies", "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", @@ -46516,24 +47960,10 @@ export function bootstrap( const { status, body } = await implementation.reposListDeploymentBranchPolicies(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - branch_policies: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = reposListDeploymentBranchPoliciesResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -46548,6 +47978,16 @@ export function bootstrap( const reposCreateDeploymentBranchPolicyBodySchema = s_deployment_branch_policy_name_pattern + const reposCreateDeploymentBranchPolicyResponseValidator = + responseValidationFactory( + [ + ["200", s_deployment_branch_policy], + ["303", z.void()], + ["404", z.void()], + ], + undefined + ) + router.post( "reposCreateDeploymentBranchPolicy", "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies", @@ -46567,14 +48007,10 @@ export function bootstrap( const { status, body } = await implementation.reposCreateDeploymentBranchPolicy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_deployment_branch_policy], - ["303", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = reposCreateDeploymentBranchPolicyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -46587,6 +48023,9 @@ export function bootstrap( branch_policy_id: z.coerce.number(), }) + const reposGetDeploymentBranchPolicyResponseValidator = + responseValidationFactory([["200", s_deployment_branch_policy]], undefined) + router.get( "reposGetDeploymentBranchPolicy", "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", @@ -46603,10 +48042,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetDeploymentBranchPolicy(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_deployment_branch_policy]], - undefined - )(status, body) + ctx.body = reposGetDeploymentBranchPolicyResponseValidator(status, body) ctx.status = status return next() } @@ -46622,6 +48058,9 @@ export function bootstrap( const reposUpdateDeploymentBranchPolicyBodySchema = s_deployment_branch_policy_name_pattern + const reposUpdateDeploymentBranchPolicyResponseValidator = + responseValidationFactory([["200", s_deployment_branch_policy]], undefined) + router.put( "reposUpdateDeploymentBranchPolicy", "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", @@ -46641,10 +48080,10 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateDeploymentBranchPolicy(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_deployment_branch_policy]], - undefined - )(status, body) + ctx.body = reposUpdateDeploymentBranchPolicyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -46657,6 +48096,9 @@ export function bootstrap( branch_policy_id: z.coerce.number(), }) + const reposDeleteDeploymentBranchPolicyResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reposDeleteDeploymentBranchPolicy", "/repos/:owner/:repo/environments/:environmentName/deployment-branch-policies/:branchPolicyId", @@ -46673,7 +48115,7 @@ export function bootstrap( const { status, body } = await implementation.reposDeleteDeploymentBranchPolicy(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = reposDeleteDeploymentBranchPolicyResponseValidator( status, body ) @@ -46692,112 +48134,119 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "activityListRepoEvents", - "/repos/:owner/:repo/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListRepoEventsParamSchema, - ctx.params - ), - query: parseRequestInput(activityListRepoEventsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.activityListRepoEvents( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ + const activityListRepoEventsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z + .object({ id: z.coerce.number(), - name: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - }), - org: z - .object({ - id: z.coerce.number(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), login: z.coerce.string(), - display_login: z.coerce.string().optional(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), gravatar_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -46819,45 +48268,112 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - milestone: z.object({ + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -46879,352 +48395,215 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z + }) + .optional(), + forks: z.coerce.number(), + permissions: z .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z + full_name: z.coerce.string().optional(), + owner: z .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), is_template: z.coerce.boolean().optional(), topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -47246,110 +48625,170 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), }) .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - comment: z + performed_via_github_app: z .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - user: z.object({ + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -47372,109 +48811,84 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - ) + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + + router.get( + "activityListRepoEvents", + "/repos/:owner/:repo/events", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListRepoEventsParamSchema, + ctx.params + ), + query: parseRequestInput(activityListRepoEventsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.activityListRepoEvents( + input, + ctx + ) + + ctx.body = activityListRepoEventsResponseValidator(status, body) ctx.status = status return next() } @@ -47491,191 +48905,184 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reposListForks", - "/repos/:owner/:repo/forks", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListForksParamSchema, ctx.params), - query: parseRequestInput(reposListForksQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListForks(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + const reposListForksResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - license: z + secret_scanning: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + secret_scanning_push_protection: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), }) - ), - ], - ["400", s_scim_error], - ], - undefined - )(status, body) + .optional(), + }) + ), + ], + ["400", s_scim_error], + ], + undefined + ) + + router.get( + "reposListForks", + "/repos/:owner/:repo/forks", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListForksParamSchema, ctx.params), + query: parseRequestInput(reposListForksQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListForks(input, ctx) + + ctx.body = reposListForksResponseValidator(status, body) ctx.status = status return next() } @@ -47694,6 +49101,17 @@ export function bootstrap( }) .optional() + const reposCreateForkResponseValidator = responseValidationFactory( + [ + ["202", s_full_repository], + ["400", s_scim_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateFork", "/repos/:owner/:repo/forks", @@ -47706,16 +49124,7 @@ export function bootstrap( const { status, body } = await implementation.reposCreateFork(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", s_full_repository], - ["400", s_scim_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateForkResponseValidator(status, body) ctx.status = status return next() } @@ -47731,6 +49140,17 @@ export function bootstrap( encoding: z.coerce.string().optional(), }) + const gitCreateBlobResponseValidator = responseValidationFactory( + [ + ["201", s_short_blob], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "gitCreateBlob", "/repos/:owner/:repo/git/blobs", @@ -47743,16 +49163,7 @@ export function bootstrap( const { status, body } = await implementation.gitCreateBlob(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_short_blob], - ["403", s_basic_error], - ["404", s_basic_error], - ["409", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitCreateBlobResponseValidator(status, body) ctx.status = status return next() } @@ -47764,6 +49175,16 @@ export function bootstrap( file_sha: z.coerce.string(), }) + const gitGetBlobResponseValidator = responseValidationFactory( + [ + ["200", s_blob], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "gitGetBlob", "/repos/:owner/:repo/git/blobs/:fileSha", @@ -47776,15 +49197,7 @@ export function bootstrap( const { status, body } = await implementation.gitGetBlob(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_blob], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitGetBlobResponseValidator(status, body) ctx.status = status return next() } @@ -47816,6 +49229,15 @@ export function bootstrap( signature: z.coerce.string().optional(), }) + const gitCreateCommitResponseValidator = responseValidationFactory( + [ + ["201", s_git_commit], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "gitCreateCommit", "/repos/:owner/:repo/git/commits", @@ -47828,14 +49250,7 @@ export function bootstrap( const { status, body } = await implementation.gitCreateCommit(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_git_commit], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitCreateCommitResponseValidator(status, body) ctx.status = status return next() } @@ -47847,6 +49262,14 @@ export function bootstrap( commit_sha: z.coerce.string(), }) + const gitGetCommitResponseValidator = responseValidationFactory( + [ + ["200", s_git_commit], + ["404", s_basic_error], + ], + undefined + ) + router.get( "gitGetCommit", "/repos/:owner/:repo/git/commits/:commitSha", @@ -47859,13 +49282,7 @@ export function bootstrap( const { status, body } = await implementation.gitGetCommit(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_git_commit], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gitGetCommitResponseValidator(status, body) ctx.status = status return next() } @@ -47877,12 +49294,33 @@ export function bootstrap( ref: z.coerce.string(), }) - router.get( - "gitListMatchingRefs", - "/repos/:owner/:repo/git/matching-refs/:ref", - async (ctx, next) => { - const input = { - params: parseRequestInput(gitListMatchingRefsParamSchema, ctx.params), + const gitListMatchingRefsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref: z.coerce.string(), + node_id: z.coerce.string(), + url: z.coerce.string(), + object: z.object({ + type: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + }), + }) + ), + ], + ], + undefined + ) + + router.get( + "gitListMatchingRefs", + "/repos/:owner/:repo/git/matching-refs/:ref", + async (ctx, next) => { + const input = { + params: parseRequestInput(gitListMatchingRefsParamSchema, ctx.params), query: undefined, body: undefined, } @@ -47892,26 +49330,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref: z.coerce.string(), - node_id: z.coerce.string(), - url: z.coerce.string(), - object: z.object({ - type: z.coerce.string(), - sha: z.coerce.string(), - url: z.coerce.string(), - }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = gitListMatchingRefsResponseValidator(status, body) ctx.status = status return next() } @@ -47923,6 +49342,14 @@ export function bootstrap( ref: z.coerce.string(), }) + const gitGetRefResponseValidator = responseValidationFactory( + [ + ["200", s_git_ref], + ["404", s_basic_error], + ], + undefined + ) + router.get( "gitGetRef", "/repos/:owner/:repo/git/ref/:ref", @@ -47935,13 +49362,7 @@ export function bootstrap( const { status, body } = await implementation.gitGetRef(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_git_ref], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gitGetRefResponseValidator(status, body) ctx.status = status return next() } @@ -47958,6 +49379,14 @@ export function bootstrap( key: z.coerce.string().optional(), }) + const gitCreateRefResponseValidator = responseValidationFactory( + [ + ["201", s_git_ref], + ["422", s_validation_error], + ], + undefined + ) + router.post( "gitCreateRef", "/repos/:owner/:repo/git/refs", @@ -47970,13 +49399,7 @@ export function bootstrap( const { status, body } = await implementation.gitCreateRef(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_git_ref], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitCreateRefResponseValidator(status, body) ctx.status = status return next() } @@ -47993,6 +49416,14 @@ export function bootstrap( force: z.coerce.boolean().optional(), }) + const gitUpdateRefResponseValidator = responseValidationFactory( + [ + ["200", s_git_ref], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "gitUpdateRef", "/repos/:owner/:repo/git/refs/:ref", @@ -48005,13 +49436,7 @@ export function bootstrap( const { status, body } = await implementation.gitUpdateRef(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_git_ref], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitUpdateRefResponseValidator(status, body) ctx.status = status return next() } @@ -48023,6 +49448,14 @@ export function bootstrap( ref: z.coerce.string(), }) + const gitDeleteRefResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "gitDeleteRef", "/repos/:owner/:repo/git/refs/:ref", @@ -48035,13 +49468,7 @@ export function bootstrap( const { status, body } = await implementation.gitDeleteRef(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitDeleteRefResponseValidator(status, body) ctx.status = status return next() } @@ -48066,6 +49493,14 @@ export function bootstrap( .optional(), }) + const gitCreateTagResponseValidator = responseValidationFactory( + [ + ["201", s_git_tag], + ["422", s_validation_error], + ], + undefined + ) + router.post( "gitCreateTag", "/repos/:owner/:repo/git/tags", @@ -48078,13 +49513,7 @@ export function bootstrap( const { status, body } = await implementation.gitCreateTag(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_git_tag], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitCreateTagResponseValidator(status, body) ctx.status = status return next() } @@ -48096,6 +49525,14 @@ export function bootstrap( tag_sha: z.coerce.string(), }) + const gitGetTagResponseValidator = responseValidationFactory( + [ + ["200", s_git_tag], + ["404", s_basic_error], + ], + undefined + ) + router.get( "gitGetTag", "/repos/:owner/:repo/git/tags/:tagSha", @@ -48108,13 +49545,7 @@ export function bootstrap( const { status, body } = await implementation.gitGetTag(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_git_tag], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = gitGetTagResponseValidator(status, body) ctx.status = status return next() } @@ -48140,6 +49571,16 @@ export function bootstrap( base_tree: z.coerce.string().optional(), }) + const gitCreateTreeResponseValidator = responseValidationFactory( + [ + ["201", s_git_tree], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "gitCreateTree", "/repos/:owner/:repo/git/trees", @@ -48152,15 +49593,7 @@ export function bootstrap( const { status, body } = await implementation.gitCreateTree(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_git_tree], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitCreateTreeResponseValidator(status, body) ctx.status = status return next() } @@ -48176,6 +49609,15 @@ export function bootstrap( recursive: z.coerce.string().optional(), }) + const gitGetTreeResponseValidator = responseValidationFactory( + [ + ["200", s_git_tree], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "gitGetTree", "/repos/:owner/:repo/git/trees/:treeSha", @@ -48188,14 +49630,7 @@ export function bootstrap( const { status, body } = await implementation.gitGetTree(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_git_tree], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gitGetTreeResponseValidator(status, body) ctx.status = status return next() } @@ -48211,6 +49646,48 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListWebhooksResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + type: z.coerce.string(), + id: z.coerce.number(), + name: z.coerce.string(), + active: z.coerce.boolean(), + events: z.array(z.coerce.string()), + config: z.object({ + email: z.coerce.string().optional(), + password: z.coerce.string().optional(), + room: z.coerce.string().optional(), + subdomain: z.coerce.string().optional(), + url: z.coerce.string().optional(), + insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), + content_type: z.coerce.string().optional(), + digest: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + token: z.coerce.string().optional(), + }), + updated_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + test_url: z.coerce.string(), + ping_url: z.coerce.string(), + deliveries_url: z.coerce.string().optional(), + last_response: z.object({ + code: z.coerce.number(), + status: z.coerce.string(), + message: z.coerce.string(), + }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposListWebhooks", "/repos/:owner/:repo/hooks", @@ -48226,47 +49703,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - type: z.coerce.string(), - id: z.coerce.number(), - name: z.coerce.string(), - active: z.coerce.boolean(), - events: z.array(z.coerce.string()), - config: z.object({ - email: z.coerce.string().optional(), - password: z.coerce.string().optional(), - room: z.coerce.string().optional(), - subdomain: z.coerce.string().optional(), - url: z.coerce.string().optional(), - insecure_ssl: z.union([z.coerce.string(), z.coerce.number()]), - content_type: z.coerce.string().optional(), - digest: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - token: z.coerce.string().optional(), - }), - updated_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - test_url: z.coerce.string(), - ping_url: z.coerce.string(), - deliveries_url: z.coerce.string().optional(), - last_response: z.object({ - code: z.coerce.number(), - status: z.coerce.string(), - message: z.coerce.string(), - }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposListWebhooksResponseValidator(status, body) ctx.status = status return next() } @@ -48295,6 +49732,16 @@ export function bootstrap( }) .optional() + const reposCreateWebhookResponseValidator = responseValidationFactory( + [ + ["201", s_hook], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateWebhook", "/repos/:owner/:repo/hooks", @@ -48310,15 +49757,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_hook], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -48330,6 +49769,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const reposGetWebhookResponseValidator = responseValidationFactory( + [ + ["200", s_hook], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetWebhook", "/repos/:owner/:repo/hooks/:hookId", @@ -48342,13 +49789,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetWebhook(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_hook], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -48377,6 +49818,15 @@ export function bootstrap( active: z.coerce.boolean().optional(), }) + const reposUpdateWebhookResponseValidator = responseValidationFactory( + [ + ["200", s_hook], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "reposUpdateWebhook", "/repos/:owner/:repo/hooks/:hookId", @@ -48392,14 +49842,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_hook], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposUpdateWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -48411,6 +49854,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const reposDeleteWebhookResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteWebhook", "/repos/:owner/:repo/hooks/:hookId", @@ -48426,13 +49877,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -48444,6 +49889,9 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const reposGetWebhookConfigForRepoResponseValidator = + responseValidationFactory([["200", s_webhook_config]], undefined) + router.get( "reposGetWebhookConfigForRepo", "/repos/:owner/:repo/hooks/:hookId/config", @@ -48460,10 +49908,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetWebhookConfigForRepo(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_webhook_config]], - undefined - )(status, body) + ctx.body = reposGetWebhookConfigForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -48484,6 +49929,9 @@ export function bootstrap( }) .optional() + const reposUpdateWebhookConfigForRepoResponseValidator = + responseValidationFactory([["200", s_webhook_config]], undefined) + router.patch( "reposUpdateWebhookConfigForRepo", "/repos/:owner/:repo/hooks/:hookId/config", @@ -48503,10 +49951,7 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateWebhookConfigForRepo(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_webhook_config]], - undefined - )(status, body) + ctx.body = reposUpdateWebhookConfigForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -48524,6 +49969,32 @@ export function bootstrap( redelivery: z.coerce.boolean().optional(), }) + const reposListWebhookDeliveriesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + guid: z.coerce.string(), + delivered_at: z.coerce.string().datetime({ offset: true }), + redelivery: z.coerce.boolean(), + duration: z.coerce.number(), + status: z.coerce.string(), + status_code: z.coerce.number(), + event: z.coerce.string(), + action: z.coerce.string(), + installation_id: z.coerce.number(), + repository_id: z.coerce.number(), + }) + ), + ], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "reposListWebhookDeliveries", "/repos/:owner/:repo/hooks/:hookId/deliveries", @@ -48545,31 +50016,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - guid: z.coerce.string(), - delivered_at: z.coerce.string().datetime({ offset: true }), - redelivery: z.coerce.boolean(), - duration: z.coerce.number(), - status: z.coerce.string(), - status_code: z.coerce.number(), - event: z.coerce.string(), - action: z.coerce.string(), - installation_id: z.coerce.number(), - repository_id: z.coerce.number(), - }) - ), - ], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposListWebhookDeliveriesResponseValidator(status, body) ctx.status = status return next() } @@ -48582,6 +50029,15 @@ export function bootstrap( delivery_id: z.coerce.number(), }) + const reposGetWebhookDeliveryResponseValidator = responseValidationFactory( + [ + ["200", s_hook_delivery], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "reposGetWebhookDelivery", "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId", @@ -48600,14 +50056,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_hook_delivery], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposGetWebhookDeliveryResponseValidator(status, body) ctx.status = status return next() } @@ -48620,6 +50069,16 @@ export function bootstrap( delivery_id: z.coerce.number(), }) + const reposRedeliverWebhookDeliveryResponseValidator = + responseValidationFactory( + [ + ["202", z.object({})], + ["400", s_scim_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposRedeliverWebhookDelivery", "/repos/:owner/:repo/hooks/:hookId/deliveries/:deliveryId/attempts", @@ -48636,14 +50095,7 @@ export function bootstrap( const { status, body } = await implementation.reposRedeliverWebhookDelivery(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["400", s_scim_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposRedeliverWebhookDeliveryResponseValidator(status, body) ctx.status = status return next() } @@ -48655,6 +50107,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const reposPingWebhookResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.post( "reposPingWebhook", "/repos/:owner/:repo/hooks/:hookId/pings", @@ -48667,13 +50127,7 @@ export function bootstrap( const { status, body } = await implementation.reposPingWebhook(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposPingWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -48685,6 +50139,14 @@ export function bootstrap( hook_id: z.coerce.number(), }) + const reposTestPushWebhookResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.post( "reposTestPushWebhook", "/repos/:owner/:repo/hooks/:hookId/tests", @@ -48700,13 +50162,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposTestPushWebhookResponseValidator(status, body) ctx.status = status return next() } @@ -48717,6 +50173,15 @@ export function bootstrap( repo: z.coerce.string(), }) + const migrationsGetImportStatusResponseValidator = responseValidationFactory( + [ + ["200", s_import], + ["404", s_basic_error], + ["503", s_basic_error], + ], + undefined + ) + router.get( "migrationsGetImportStatus", "/repos/:owner/:repo/import", @@ -48735,14 +50200,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_import], - ["404", s_basic_error], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsGetImportStatusResponseValidator(status, body) ctx.status = status return next() } @@ -48761,6 +50219,16 @@ export function bootstrap( tfvc_project: z.coerce.string().optional(), }) + const migrationsStartImportResponseValidator = responseValidationFactory( + [ + ["201", s_import], + ["404", s_basic_error], + ["422", s_validation_error], + ["503", s_basic_error], + ], + undefined + ) + router.put( "migrationsStartImport", "/repos/:owner/:repo/import", @@ -48776,15 +50244,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_import], - ["404", s_basic_error], - ["422", s_validation_error], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsStartImportResponseValidator(status, body) ctx.status = status return next() } @@ -48804,6 +50264,14 @@ export function bootstrap( }) .optional() + const migrationsUpdateImportResponseValidator = responseValidationFactory( + [ + ["200", s_import], + ["503", s_basic_error], + ], + undefined + ) + router.patch( "migrationsUpdateImport", "/repos/:owner/:repo/import", @@ -48822,13 +50290,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_import], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsUpdateImportResponseValidator(status, body) ctx.status = status return next() } @@ -48839,6 +50301,14 @@ export function bootstrap( repo: z.coerce.string(), }) + const migrationsCancelImportResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["503", s_basic_error], + ], + undefined + ) + router.delete( "migrationsCancelImport", "/repos/:owner/:repo/import", @@ -48857,13 +50327,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsCancelImportResponseValidator(status, body) ctx.status = status return next() } @@ -48878,6 +50342,28 @@ export function bootstrap( since: z.coerce.number().optional(), }) + const migrationsGetCommitAuthorsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + remote_id: z.coerce.string(), + remote_name: z.coerce.string(), + email: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + import_url: z.coerce.string(), + }) + ), + ], + ["404", s_basic_error], + ["503", s_basic_error], + ], + undefined + ) + router.get( "migrationsGetCommitAuthors", "/repos/:owner/:repo/import/authors", @@ -48899,27 +50385,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - remote_id: z.coerce.string(), - remote_name: z.coerce.string(), - email: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - import_url: z.coerce.string(), - }) - ), - ], - ["404", s_basic_error], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsGetCommitAuthorsResponseValidator(status, body) ctx.status = status return next() } @@ -48938,6 +50404,16 @@ export function bootstrap( }) .optional() + const migrationsMapCommitAuthorResponseValidator = responseValidationFactory( + [ + ["200", s_porter_author], + ["404", s_basic_error], + ["422", s_validation_error], + ["503", s_basic_error], + ], + undefined + ) + router.patch( "migrationsMapCommitAuthor", "/repos/:owner/:repo/import/authors/:authorId", @@ -48956,15 +50432,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_porter_author], - ["404", s_basic_error], - ["422", s_validation_error], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsMapCommitAuthorResponseValidator(status, body) ctx.status = status return next() } @@ -48975,6 +50443,24 @@ export function bootstrap( repo: z.coerce.string(), }) + const migrationsGetLargeFilesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + ref_name: z.coerce.string(), + path: z.coerce.string(), + oid: z.coerce.string(), + size: z.coerce.number(), + }) + ), + ], + ["503", s_basic_error], + ], + undefined + ) + router.get( "migrationsGetLargeFiles", "/repos/:owner/:repo/import/large_files", @@ -48993,23 +50479,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - ref_name: z.coerce.string(), - path: z.coerce.string(), - oid: z.coerce.string(), - size: z.coerce.number(), - }) - ), - ], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsGetLargeFilesResponseValidator(status, body) ctx.status = status return next() } @@ -49024,6 +50494,15 @@ export function bootstrap( use_lfs: z.enum(["opt_in", "opt_out"]), }) + const migrationsSetLfsPreferenceResponseValidator = responseValidationFactory( + [ + ["200", s_import], + ["422", s_validation_error], + ["503", s_basic_error], + ], + undefined + ) + router.patch( "migrationsSetLfsPreference", "/repos/:owner/:repo/import/lfs", @@ -49042,14 +50521,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_import], - ["422", s_validation_error], - ["503", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsSetLfsPreferenceResponseValidator(status, body) ctx.status = status return next() } @@ -49060,6 +50532,15 @@ export function bootstrap( repo: z.coerce.string(), }) + const appsGetRepoInstallationResponseValidator = responseValidationFactory( + [ + ["200", s_installation], + ["301", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "appsGetRepoInstallation", "/repos/:owner/:repo/installation", @@ -49078,14 +50559,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_installation], - ["301", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsGetRepoInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -49096,6 +50570,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const interactionsGetRestrictionsForRepoResponseValidator = + responseValidationFactory([["200", z.object({})]], undefined) + router.get( "interactionsGetRestrictionsForRepo", "/repos/:owner/:repo/interaction-limits", @@ -49112,7 +50589,7 @@ export function bootstrap( const { status, body } = await implementation.interactionsGetRestrictionsForRepo(input, ctx) - ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( + ctx.body = interactionsGetRestrictionsForRepoResponseValidator( status, body ) @@ -49128,6 +50605,15 @@ export function bootstrap( const interactionsSetRestrictionsForRepoBodySchema = s_interaction_limit + const interactionsSetRestrictionsForRepoResponseValidator = + responseValidationFactory( + [ + ["200", s_interaction_limit_response], + ["409", z.void()], + ], + undefined + ) + router.put( "interactionsSetRestrictionsForRepo", "/repos/:owner/:repo/interaction-limits", @@ -49147,13 +50633,10 @@ export function bootstrap( const { status, body } = await implementation.interactionsSetRestrictionsForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_interaction_limit_response], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = interactionsSetRestrictionsForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -49164,6 +50647,15 @@ export function bootstrap( repo: z.coerce.string(), }) + const interactionsRemoveRestrictionsForRepoResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["409", z.void()], + ], + undefined + ) + router.delete( "interactionsRemoveRestrictionsForRepo", "/repos/:owner/:repo/interaction-limits", @@ -49180,13 +50672,10 @@ export function bootstrap( const { status, body } = await implementation.interactionsRemoveRestrictionsForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["409", z.void()], - ], - undefined - )(status, body) + ctx.body = interactionsRemoveRestrictionsForRepoResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -49202,6 +50691,240 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListInvitationsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ), + ], + ], + undefined + ) + router.get( "reposListInvitations", "/repos/:owner/:repo/invitations", @@ -49217,239 +50940,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListInvitationsResponseValidator(status, body) ctx.status = status return next() } @@ -49469,6 +50960,11 @@ export function bootstrap( }) .optional() + const reposUpdateInvitationResponseValidator = responseValidationFactory( + [["200", s_repository_invitation]], + undefined + ) + router.patch( "reposUpdateInvitation", "/repos/:owner/:repo/invitations/:invitationId", @@ -49484,10 +50980,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_repository_invitation]], - undefined - )(status, body) + ctx.body = reposUpdateInvitationResponseValidator(status, body) ctx.status = status return next() } @@ -49499,6 +50992,11 @@ export function bootstrap( invitation_id: z.coerce.number(), }) + const reposDeleteInvitationResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposDeleteInvitation", "/repos/:owner/:repo/invitations/:invitationId", @@ -49514,10 +51012,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDeleteInvitationResponseValidator(status, body) ctx.status = status return next() } @@ -49542,80 +51037,90 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "issuesListForRepo", - "/repos/:owner/:repo/issues", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListForRepoParamSchema, ctx.params), - query: parseRequestInput(issuesListForRepoQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + const issuesListForRepoResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -49637,94 +51142,111 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - milestone: z.object({ + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string().optional(), }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z + organization: z .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -49749,280 +51271,213 @@ export function bootstrap( starred_at: z.coerce.string().optional(), }) .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z + forks: z.coerce.number(), + permissions: z .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z .object({ + login: z.coerce.string().optional(), id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -50044,116 +51499,156 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) - ), - ], - ["301", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesCreateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - }) - - const issuesCreateBodySchema = z.object({ - title: z.union([z.coerce.string(), z.coerce.number()]), - body: z.coerce.string().optional(), - assignee: z.coerce.string().optional(), - milestone: z.union([z.coerce.string(), z.coerce.number()]), - labels: z - .array( + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["301", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.get( + "issuesListForRepo", + "/repos/:owner/:repo/issues", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesListForRepoParamSchema, ctx.params), + query: parseRequestInput(issuesListForRepoQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListForRepo( + input, + ctx + ) + + ctx.body = issuesListForRepoResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const issuesCreateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + }) + + const issuesCreateBodySchema = z.object({ + title: z.union([z.coerce.string(), z.coerce.number()]), + body: z.coerce.string().optional(), + assignee: z.coerce.string().optional(), + milestone: z.union([z.coerce.string(), z.coerce.number()]), + labels: z + .array( z.union([ z.coerce.string(), z.object({ @@ -50168,6 +51663,25 @@ export function bootstrap( assignees: z.array(z.coerce.string()).optional(), }) + const issuesCreateResponseValidator = responseValidationFactory( + [ + ["201", s_issue], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.post( "issuesCreate", "/repos/:owner/:repo/issues", @@ -50180,24 +51694,7 @@ export function bootstrap( const { status, body } = await implementation.issuesCreate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_issue], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = issuesCreateResponseValidator(status, body) ctx.status = status return next() } @@ -50216,41 +51713,61 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "issuesListCommentsForRepo", - "/repos/:owner/:repo/issues/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListCommentsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput( - issuesListCommentsForRepoQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.issuesListCommentsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ + const issuesListCommentsForRepoResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50273,90 +51790,72 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ), - ], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.get( + "issuesListCommentsForRepo", + "/repos/:owner/:repo/issues/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListCommentsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput( + issuesListCommentsForRepoQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.issuesListCommentsForRepo( + input, + ctx + ) + + ctx.body = issuesListCommentsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -50368,6 +51867,14 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const issuesGetCommentResponseValidator = responseValidationFactory( + [ + ["200", s_issue_comment], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesGetComment", "/repos/:owner/:repo/issues/comments/:commentId", @@ -50380,13 +51887,7 @@ export function bootstrap( const { status, body } = await implementation.issuesGetComment(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_issue_comment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesGetCommentResponseValidator(status, body) ctx.status = status return next() } @@ -50400,6 +51901,14 @@ export function bootstrap( const issuesUpdateCommentBodySchema = z.object({ body: z.coerce.string() }) + const issuesUpdateCommentResponseValidator = responseValidationFactory( + [ + ["200", s_issue_comment], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "issuesUpdateComment", "/repos/:owner/:repo/issues/comments/:commentId", @@ -50415,13 +51924,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_issue_comment], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesUpdateCommentResponseValidator(status, body) ctx.status = status return next() } @@ -50433,6 +51936,11 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const issuesDeleteCommentResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "issuesDeleteComment", "/repos/:owner/:repo/issues/comments/:commentId", @@ -50448,10 +51956,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = issuesDeleteCommentResponseValidator(status, body) ctx.status = status return next() } @@ -50480,6 +51985,57 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForIssueCommentResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reactionsListForIssueComment", "/repos/:owner/:repo/issues/comments/:commentId/reactions", @@ -50499,55 +52055,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForIssueComment(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reactionsListForIssueCommentResponseValidator(status, body) ctx.status = status return next() } @@ -50572,6 +52080,16 @@ export function bootstrap( ]), }) + const reactionsCreateForIssueCommentResponseValidator = + responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reactionsCreateForIssueComment", "/repos/:owner/:repo/issues/comments/:commentId/reactions", @@ -50591,14 +52109,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForIssueComment(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForIssueCommentResponseValidator(status, body) ctx.status = status return next() } @@ -50611,6 +52122,9 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForIssueCommentResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reactionsDeleteForIssueComment", "/repos/:owner/:repo/issues/comments/:commentId/reactions/:reactionId", @@ -50627,10 +52141,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForIssueComment(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reactionsDeleteForIssueCommentResponseValidator(status, body) ctx.status = status return next() } @@ -50646,34 +52157,60 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "issuesListEventsForRepo", - "/repos/:owner/:repo/issues/events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - issuesListEventsForRepoParamSchema, - ctx.params - ), - query: parseRequestInput(issuesListEventsForRepoQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListEventsForRepo( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ + const issuesListEventsForRepoResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + actor: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + event: z.coerce.string(), + commit_id: z.coerce.string(), + commit_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + issue: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), - actor: z.object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50696,28 +52233,46 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - event: z.coerce.string(), - commit_id: z.coerce.string(), - commit_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50739,82 +52294,112 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - milestone: z.object({ + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), + spdx_id: z.coerce.string(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -50836,340 +52421,215 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z + }) + .optional(), + forks: z.coerce.number(), + permissions: z .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), }) .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z + full_name: z.coerce.string().optional(), + owner: z .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), }) .optional(), - forks: z.coerce.number(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), permissions: z .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), + admin: z.coerce.boolean().optional(), maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), }) .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), temp_clone_token: z.coerce.string().optional(), allow_squash_merge: z.coerce.boolean().optional(), allow_auto_merge: z.coerce.boolean().optional(), @@ -51191,274 +52651,42 @@ export function bootstrap( .enum(["PR_BODY", "PR_TITLE", "BLANK"]) .optional(), allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), subscribers_count: z.coerce.number().optional(), network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - }) - .optional(), - label: z - .object({ name: z.coerce.string(), color: z.coerce.string() }) - .optional(), - assignee: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - assigner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - review_requester: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_reviewer: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - requested_team: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - .optional(), - dismissed_review: z - .object({ - state: z.coerce.string(), - review_id: z.coerce.number(), - dismissal_message: z.coerce.string(), - dismissal_commit_id: z.coerce.string().optional(), - }) - .optional(), - milestone: z.object({ title: z.coerce.string() }).optional(), - project_card: z - .object({ - url: z.coerce.string(), - id: z.coerce.number(), - project_url: z.coerce.string(), - project_id: z.coerce.number(), - column_name: z.coerce.string(), - previous_column_name: z.coerce.string().optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - rename: z - .object({ from: z.coerce.string(), to: z.coerce.string() }) - .optional(), - author_association: z - .enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]) - .optional(), - lock_reason: z.coerce.string().optional(), performed_via_github_app: z .object({ id: z.coerce.number(), @@ -51508,92 +52736,367 @@ export function bootstrap( pem: z.coerce.string().optional(), }) .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesGetEventParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - event_id: z.coerce.number(), - }) - - router.get( - "issuesGetEvent", - "/repos/:owner/:repo/issues/events/:eventId", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetEventParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGetEvent(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", s_issue_event], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesGetParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - router.get( - "issuesGet", - "/repos/:owner/:repo/issues/:issueNumber", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesGetParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.issuesGet(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", s_issue], - ["301", s_basic_error], - ["304", z.void()], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const issuesUpdateParamSchema = z.object({ - owner: z.coerce.string(), - repo: z.coerce.string(), - issue_number: z.coerce.number(), - }) - - const issuesUpdateBodySchema = z - .object({ - title: z.union([z.coerce.string(), z.coerce.number()]), + .optional(), + label: z + .object({ name: z.coerce.string(), color: z.coerce.string() }) + .optional(), + assignee: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + assigner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + review_requester: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_reviewer: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + requested_team: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + .optional(), + dismissed_review: z + .object({ + state: z.coerce.string(), + review_id: z.coerce.number(), + dismissal_message: z.coerce.string(), + dismissal_commit_id: z.coerce.string().optional(), + }) + .optional(), + milestone: z.object({ title: z.coerce.string() }).optional(), + project_card: z + .object({ + url: z.coerce.string(), + id: z.coerce.number(), + project_url: z.coerce.string(), + project_id: z.coerce.number(), + column_name: z.coerce.string(), + previous_column_name: z.coerce.string().optional(), + }) + .optional(), + rename: z + .object({ from: z.coerce.string(), to: z.coerce.string() }) + .optional(), + author_association: z + .enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]) + .optional(), + lock_reason: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + + router.get( + "issuesListEventsForRepo", + "/repos/:owner/:repo/issues/events", + async (ctx, next) => { + const input = { + params: parseRequestInput( + issuesListEventsForRepoParamSchema, + ctx.params + ), + query: parseRequestInput(issuesListEventsForRepoQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListEventsForRepo( + input, + ctx + ) + + ctx.body = issuesListEventsForRepoResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const issuesGetEventParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + event_id: z.coerce.number(), + }) + + const issuesGetEventResponseValidator = responseValidationFactory( + [ + ["200", s_issue_event], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + + router.get( + "issuesGetEvent", + "/repos/:owner/:repo/issues/events/:eventId", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesGetEventParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesGetEvent(input, ctx) + + ctx.body = issuesGetEventResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const issuesGetParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesGetResponseValidator = responseValidationFactory( + [ + ["200", s_issue], + ["301", s_basic_error], + ["304", z.void()], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + + router.get( + "issuesGet", + "/repos/:owner/:repo/issues/:issueNumber", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesGetParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.issuesGet(input, ctx) + + ctx.body = issuesGetResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const issuesUpdateParamSchema = z.object({ + owner: z.coerce.string(), + repo: z.coerce.string(), + issue_number: z.coerce.number(), + }) + + const issuesUpdateBodySchema = z + .object({ + title: z.union([z.coerce.string(), z.coerce.number()]), body: z.coerce.string().optional(), assignee: z.coerce.string().optional(), state: z.enum(["open", "closed"]).optional(), @@ -51616,6 +53119,26 @@ export function bootstrap( }) .optional() + const issuesUpdateResponseValidator = responseValidationFactory( + [ + ["200", s_issue], + ["301", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.patch( "issuesUpdate", "/repos/:owner/:repo/issues/:issueNumber", @@ -51628,25 +53151,7 @@ export function bootstrap( const { status, body } = await implementation.issuesUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_issue], - ["301", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = issuesUpdateResponseValidator(status, body) ctx.status = status return next() } @@ -51662,6 +53167,11 @@ export function bootstrap( .object({ assignees: z.array(z.coerce.string()).optional() }) .optional() + const issuesAddAssigneesResponseValidator = responseValidationFactory( + [["201", s_issue]], + undefined + ) + router.post( "issuesAddAssignees", "/repos/:owner/:repo/issues/:issueNumber/assignees", @@ -51677,10 +53187,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["201", s_issue]], undefined)( - status, - body - ) + ctx.body = issuesAddAssigneesResponseValidator(status, body) ctx.status = status return next() } @@ -51696,6 +53203,11 @@ export function bootstrap( assignees: z.array(z.coerce.string()).optional(), }) + const issuesRemoveAssigneesResponseValidator = responseValidationFactory( + [["200", s_issue]], + undefined + ) + router.delete( "issuesRemoveAssignees", "/repos/:owner/:repo/issues/:issueNumber/assignees", @@ -51711,10 +53223,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_issue]], undefined)( - status, - body - ) + ctx.body = issuesRemoveAssigneesResponseValidator(status, body) ctx.status = status return next() } @@ -51727,6 +53236,15 @@ export function bootstrap( assignee: z.coerce.string(), }) + const issuesCheckUserCanBeAssignedToIssueResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesCheckUserCanBeAssignedToIssue", "/repos/:owner/:repo/issues/:issueNumber/assignees/:assignee", @@ -51743,13 +53261,10 @@ export function bootstrap( const { status, body } = await implementation.issuesCheckUserCanBeAssignedToIssue(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesCheckUserCanBeAssignedToIssueResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -51767,35 +53282,61 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "issuesListComments", - "/repos/:owner/:repo/issues/:issueNumber/comments", - async (ctx, next) => { - const input = { - params: parseRequestInput(issuesListCommentsParamSchema, ctx.params), - query: parseRequestInput(issuesListCommentsQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.issuesListComments( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ + const issuesListCommentsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -51818,90 +53359,66 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ), - ], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + + router.get( + "issuesListComments", + "/repos/:owner/:repo/issues/:issueNumber/comments", + async (ctx, next) => { + const input = { + params: parseRequestInput(issuesListCommentsParamSchema, ctx.params), + query: parseRequestInput(issuesListCommentsQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.issuesListComments( + input, + ctx + ) + + ctx.body = issuesListCommentsResponseValidator(status, body) ctx.status = status return next() } @@ -51915,6 +53432,17 @@ export function bootstrap( const issuesCreateCommentBodySchema = z.object({ body: z.coerce.string() }) + const issuesCreateCommentResponseValidator = responseValidationFactory( + [ + ["201", s_issue_comment], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "issuesCreateComment", "/repos/:owner/:repo/issues/:issueNumber/comments", @@ -51930,16 +53458,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_issue_comment], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesCreateCommentResponseValidator(status, body) ctx.status = status return next() } @@ -51956,6 +53475,14 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListEventsResponseValidator = responseValidationFactory( + [ + ["200", z.array(z.object({}))], + ["410", s_basic_error], + ], + undefined + ) + router.get( "issuesListEvents", "/repos/:owner/:repo/issues/:issueNumber/events", @@ -51968,13 +53495,7 @@ export function bootstrap( const { status, body } = await implementation.issuesListEvents(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.object({}))], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesListEventsResponseValidator(status, body) ctx.status = status return next() } @@ -51991,6 +53512,29 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListLabelsOnIssueResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + router.get( "issuesListLabelsOnIssue", "/repos/:owner/:repo/issues/:issueNumber/labels", @@ -52009,28 +53553,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - ["301", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesListLabelsOnIssueResponseValidator(status, body) ctx.status = status return next() } @@ -52052,6 +53575,30 @@ export function bootstrap( z.coerce.string(), ]) + const issuesAddLabelsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "issuesAddLabels", "/repos/:owner/:repo/issues/:issueNumber/labels", @@ -52064,29 +53611,7 @@ export function bootstrap( const { status, body } = await implementation.issuesAddLabels(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - ["301", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesAddLabelsResponseValidator(status, body) ctx.status = status return next() } @@ -52108,6 +53633,30 @@ export function bootstrap( z.coerce.string(), ]) + const issuesSetLabelsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "issuesSetLabels", "/repos/:owner/:repo/issues/:issueNumber/labels", @@ -52120,29 +53669,7 @@ export function bootstrap( const { status, body } = await implementation.issuesSetLabels(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - ["301", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesSetLabelsResponseValidator(status, body) ctx.status = status return next() } @@ -52154,6 +53681,16 @@ export function bootstrap( issue_number: z.coerce.number(), }) + const issuesRemoveAllLabelsResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + router.delete( "issuesRemoveAllLabels", "/repos/:owner/:repo/issues/:issueNumber/labels", @@ -52169,15 +53706,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["301", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesRemoveAllLabelsResponseValidator(status, body) ctx.status = status return next() } @@ -52190,6 +53719,29 @@ export function bootstrap( name: z.coerce.string(), }) + const issuesRemoveLabelResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ["301", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + router.delete( "issuesRemoveLabel", "/repos/:owner/:repo/issues/:issueNumber/labels/:name", @@ -52205,28 +53757,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - ["301", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesRemoveLabelResponseValidator(status, body) ctx.status = status return next() } @@ -52246,6 +53777,17 @@ export function bootstrap( }) .optional() + const issuesLockResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "issuesLock", "/repos/:owner/:repo/issues/:issueNumber/lock", @@ -52258,16 +53800,7 @@ export function bootstrap( const { status, body } = await implementation.issuesLock(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesLockResponseValidator(status, body) ctx.status = status return next() } @@ -52279,6 +53812,15 @@ export function bootstrap( issue_number: z.coerce.number(), }) + const issuesUnlockResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "issuesUnlock", "/repos/:owner/:repo/issues/:issueNumber/lock", @@ -52291,14 +53833,7 @@ export function bootstrap( const { status, body } = await implementation.issuesUnlock(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesUnlockResponseValidator(status, body) ctx.status = status return next() } @@ -52327,6 +53862,57 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForIssueResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + router.get( "reactionsListForIssue", "/repos/:owner/:repo/issues/:issueNumber/reactions", @@ -52342,56 +53928,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reactionsListForIssueResponseValidator(status, body) ctx.status = status return next() } @@ -52416,6 +53953,15 @@ export function bootstrap( ]), }) + const reactionsCreateForIssueResponseValidator = responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reactionsCreateForIssue", "/repos/:owner/:repo/issues/:issueNumber/reactions", @@ -52434,14 +53980,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForIssueResponseValidator(status, body) ctx.status = status return next() } @@ -52454,6 +53993,11 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForIssueResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reactionsDeleteForIssue", "/repos/:owner/:repo/issues/:issueNumber/reactions/:reactionId", @@ -52472,10 +54016,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reactionsDeleteForIssueResponseValidator(status, body) ctx.status = status return next() } @@ -52492,6 +54033,16 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListEventsForTimelineResponseValidator = + responseValidationFactory( + [ + ["200", z.array(z.object({}))], + ["404", s_basic_error], + ["410", s_basic_error], + ], + undefined + ) + router.get( "issuesListEventsForTimeline", "/repos/:owner/:repo/issues/:issueNumber/timeline", @@ -52513,14 +54064,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.object({}))], - ["404", s_basic_error], - ["410", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesListEventsForTimelineResponseValidator(status, body) ctx.status = status return next() } @@ -52536,6 +54080,28 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListDeployKeysResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + key: z.coerce.string(), + url: z.coerce.string(), + title: z.coerce.string(), + verified: z.coerce.boolean(), + created_at: z.coerce.string(), + read_only: z.coerce.boolean(), + added_by: z.coerce.string().optional(), + last_used: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "reposListDeployKeys", "/repos/:owner/:repo/keys", @@ -52551,27 +54117,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - key: z.coerce.string(), - url: z.coerce.string(), - title: z.coerce.string(), - verified: z.coerce.boolean(), - created_at: z.coerce.string(), - read_only: z.coerce.boolean(), - added_by: z.coerce.string().optional(), - last_used: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListDeployKeysResponseValidator(status, body) ctx.status = status return next() } @@ -52588,6 +54134,14 @@ export function bootstrap( read_only: z.coerce.boolean().optional(), }) + const reposCreateDeployKeyResponseValidator = responseValidationFactory( + [ + ["201", s_deploy_key], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateDeployKey", "/repos/:owner/:repo/keys", @@ -52603,13 +54157,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_deploy_key], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateDeployKeyResponseValidator(status, body) ctx.status = status return next() } @@ -52621,6 +54169,14 @@ export function bootstrap( key_id: z.coerce.number(), }) + const reposGetDeployKeyResponseValidator = responseValidationFactory( + [ + ["200", s_deploy_key], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetDeployKey", "/repos/:owner/:repo/keys/:keyId", @@ -52636,13 +54192,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_deploy_key], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetDeployKeyResponseValidator(status, body) ctx.status = status return next() } @@ -52654,6 +54204,11 @@ export function bootstrap( key_id: z.coerce.number(), }) + const reposDeleteDeployKeyResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposDeleteDeployKey", "/repos/:owner/:repo/keys/:keyId", @@ -52669,10 +54224,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDeleteDeployKeyResponseValidator(status, body) ctx.status = status return next() } @@ -52688,6 +54240,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListLabelsForRepoResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesListLabelsForRepo", "/repos/:owner/:repo/labels", @@ -52706,26 +54279,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesListLabelsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -52742,6 +54296,15 @@ export function bootstrap( description: z.coerce.string().optional(), }) + const issuesCreateLabelResponseValidator = responseValidationFactory( + [ + ["201", s_label], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "issuesCreateLabel", "/repos/:owner/:repo/labels", @@ -52757,14 +54320,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_label], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesCreateLabelResponseValidator(status, body) ctx.status = status return next() } @@ -52776,6 +54332,14 @@ export function bootstrap( name: z.coerce.string(), }) + const issuesGetLabelResponseValidator = responseValidationFactory( + [ + ["200", s_label], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesGetLabel", "/repos/:owner/:repo/labels/:name", @@ -52788,13 +54352,7 @@ export function bootstrap( const { status, body } = await implementation.issuesGetLabel(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_label], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesGetLabelResponseValidator(status, body) ctx.status = status return next() } @@ -52814,6 +54372,11 @@ export function bootstrap( }) .optional() + const issuesUpdateLabelResponseValidator = responseValidationFactory( + [["200", s_label]], + undefined + ) + router.patch( "issuesUpdateLabel", "/repos/:owner/:repo/labels/:name", @@ -52829,10 +54392,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_label]], undefined)( - status, - body - ) + ctx.body = issuesUpdateLabelResponseValidator(status, body) ctx.status = status return next() } @@ -52844,6 +54404,11 @@ export function bootstrap( name: z.coerce.string(), }) + const issuesDeleteLabelResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "issuesDeleteLabel", "/repos/:owner/:repo/labels/:name", @@ -52859,10 +54424,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = issuesDeleteLabelResponseValidator(status, body) ctx.status = status return next() } @@ -52873,6 +54435,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposListLanguagesResponseValidator = responseValidationFactory( + [["200", s_language]], + undefined + ) + router.get( "reposListLanguages", "/repos/:owner/:repo/languages", @@ -52888,10 +54455,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_language]], undefined)( - status, - body - ) + ctx.body = reposListLanguagesResponseValidator(status, body) ctx.status = status return next() } @@ -52902,6 +54466,14 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposEnableLfsForRepoResponseValidator = responseValidationFactory( + [ + ["202", z.object({})], + ["403", z.void()], + ], + undefined + ) + router.put( "reposEnableLfsForRepo", "/repos/:owner/:repo/lfs", @@ -52917,13 +54489,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["403", z.void()], - ], - undefined - )(status, body) + ctx.body = reposEnableLfsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -52934,6 +54500,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposDisableLfsForRepoResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposDisableLfsForRepo", "/repos/:owner/:repo/lfs", @@ -52952,10 +54523,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDisableLfsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -52966,6 +54534,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const licensesGetForRepoResponseValidator = responseValidationFactory( + [["200", s_license_content]], + undefined + ) + router.get( "licensesGetForRepo", "/repos/:owner/:repo/license", @@ -52981,10 +54554,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_license_content]], - undefined - )(status, body) + ctx.body = licensesGetForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -52997,6 +54567,15 @@ export function bootstrap( const reposMergeUpstreamBodySchema = z.object({ branch: z.coerce.string() }) + const reposMergeUpstreamResponseValidator = responseValidationFactory( + [ + ["200", s_merged_upstream], + ["409", z.void()], + ["422", z.void()], + ], + undefined + ) + router.post( "reposMergeUpstream", "/repos/:owner/:repo/merge-upstream", @@ -53012,14 +54591,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_merged_upstream], - ["409", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = reposMergeUpstreamResponseValidator(status, body) ctx.status = status return next() } @@ -53036,6 +54608,18 @@ export function bootstrap( commit_message: z.coerce.string().optional(), }) + const reposMergeResponseValidator = responseValidationFactory( + [ + ["201", s_commit], + ["204", z.void()], + ["403", s_basic_error], + ["404", z.void()], + ["409", z.void()], + ["422", s_validation_error], + ], + undefined + ) + router.post("reposMerge", "/repos/:owner/:repo/merges", async (ctx, next) => { const input = { params: parseRequestInput(reposMergeParamSchema, ctx.params), @@ -53045,17 +54629,7 @@ export function bootstrap( const { status, body } = await implementation.reposMerge(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_commit], - ["204", z.void()], - ["403", s_basic_error], - ["404", z.void()], - ["409", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposMergeResponseValidator(status, body) ctx.status = status return next() }) @@ -53073,6 +54647,58 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListMilestonesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesListMilestones", "/repos/:owner/:repo/milestones", @@ -53088,57 +54714,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesListMilestonesResponseValidator(status, body) ctx.status = status return next() } @@ -53156,6 +54732,15 @@ export function bootstrap( due_on: z.coerce.string().datetime({ offset: true }).optional(), }) + const issuesCreateMilestoneResponseValidator = responseValidationFactory( + [ + ["201", s_milestone], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "issuesCreateMilestone", "/repos/:owner/:repo/milestones", @@ -53171,14 +54756,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_milestone], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = issuesCreateMilestoneResponseValidator(status, body) ctx.status = status return next() } @@ -53190,6 +54768,14 @@ export function bootstrap( milestone_number: z.coerce.number(), }) + const issuesGetMilestoneResponseValidator = responseValidationFactory( + [ + ["200", s_milestone], + ["404", s_basic_error], + ], + undefined + ) + router.get( "issuesGetMilestone", "/repos/:owner/:repo/milestones/:milestoneNumber", @@ -53205,13 +54791,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_milestone], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesGetMilestoneResponseValidator(status, body) ctx.status = status return next() } @@ -53232,6 +54812,11 @@ export function bootstrap( }) .optional() + const issuesUpdateMilestoneResponseValidator = responseValidationFactory( + [["200", s_milestone]], + undefined + ) + router.patch( "issuesUpdateMilestone", "/repos/:owner/:repo/milestones/:milestoneNumber", @@ -53247,10 +54832,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_milestone]], undefined)( - status, - body - ) + ctx.body = issuesUpdateMilestoneResponseValidator(status, body) ctx.status = status return next() } @@ -53262,6 +54844,14 @@ export function bootstrap( milestone_number: z.coerce.number(), }) + const issuesDeleteMilestoneResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "issuesDeleteMilestone", "/repos/:owner/:repo/milestones/:milestoneNumber", @@ -53277,13 +54867,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = issuesDeleteMilestoneResponseValidator(status, body) ctx.status = status return next() } @@ -53300,6 +54884,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const issuesListLabelsForMilestoneResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + ], + ], + undefined + ) + router.get( "issuesListLabelsForMilestone", "/repos/:owner/:repo/milestones/:milestoneNumber/labels", @@ -53319,25 +54924,7 @@ export function bootstrap( const { status, body } = await implementation.issuesListLabelsForMilestone(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = issuesListLabelsForMilestoneResponseValidator(status, body) ctx.status = status return next() } @@ -53358,215 +54945,222 @@ export function bootstrap( } ) - router.get( - "activityListRepoNotificationsForAuthenticatedUser", - "/repos/:owner/:repo/notifications", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListRepoNotificationsForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListRepoNotificationsForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListRepoNotificationsForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const activityListRepoNotificationsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - repository: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - subject: z.object({ - title: z.coerce.string(), - url: z.coerce.string(), - latest_comment_url: z.coerce.string(), + received_events_url: z.coerce.string(), type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - reason: z.coerce.string(), - unread: z.coerce.boolean(), - updated_at: z.coerce.string(), - last_read_at: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), subscription_url: z.coerce.string(), - }) - ), - ], + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + subject: z.object({ + title: z.coerce.string(), + url: z.coerce.string(), + latest_comment_url: z.coerce.string(), + type: z.coerce.string(), + }), + reason: z.coerce.string(), + unread: z.coerce.boolean(), + updated_at: z.coerce.string(), + last_read_at: z.coerce.string(), + url: z.coerce.string(), + subscription_url: z.coerce.string(), + }) + ), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "activityListRepoNotificationsForAuthenticatedUser", + "/repos/:owner/:repo/notifications", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListRepoNotificationsForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListRepoNotificationsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListRepoNotificationsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = + activityListRepoNotificationsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -53583,6 +55177,21 @@ export function bootstrap( }) .optional() + const activityMarkRepoNotificationsAsReadResponseValidator = + responseValidationFactory( + [ + [ + "202", + z.object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }), + ], + ["205", z.void()], + ], + undefined + ) + router.put( "activityMarkRepoNotificationsAsRead", "/repos/:owner/:repo/notifications", @@ -53602,19 +55211,10 @@ export function bootstrap( const { status, body } = await implementation.activityMarkRepoNotificationsAsRead(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "202", - z.object({ - message: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }), - ], - ["205", z.void()], - ], - undefined - )(status, body) + ctx.body = activityMarkRepoNotificationsAsReadResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -53625,6 +55225,14 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetPagesResponseValidator = responseValidationFactory( + [ + ["200", s_page], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetPages", "/repos/:owner/:repo/pages", @@ -53637,13 +55245,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetPages(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_page], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetPagesResponseValidator(status, body) ctx.status = status return next() } @@ -53664,6 +55266,15 @@ export function bootstrap( .optional(), }) + const reposCreatePagesSiteResponseValidator = responseValidationFactory( + [ + ["201", s_page], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreatePagesSite", "/repos/:owner/:repo/pages", @@ -53679,14 +55290,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_page], - ["409", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreatePagesSiteResponseValidator(status, body) ctx.status = status return next() } @@ -53704,6 +55308,17 @@ export function bootstrap( source: z.object({}).optional(), }) + const reposUpdateInformationAboutPagesSiteResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["400", s_scim_error], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "reposUpdateInformationAboutPagesSite", "/repos/:owner/:repo/pages", @@ -53723,15 +55338,10 @@ export function bootstrap( const { status, body } = await implementation.reposUpdateInformationAboutPagesSite(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["400", s_scim_error], - ["409", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposUpdateInformationAboutPagesSiteResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -53742,6 +55352,16 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposDeletePagesSiteResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["409", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "reposDeletePagesSite", "/repos/:owner/:repo/pages", @@ -53757,15 +55377,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["409", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposDeletePagesSiteResponseValidator(status, body) ctx.status = status return next() } @@ -53781,6 +55393,49 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListPagesBuildsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + status: z.coerce.string(), + error: z.object({ message: z.coerce.string() }), + pusher: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + commit: z.coerce.string(), + duration: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + router.get( "reposListPagesBuilds", "/repos/:owner/:repo/pages/builds", @@ -53796,48 +55451,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - status: z.coerce.string(), - error: z.object({ message: z.coerce.string() }), - pusher: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - commit: z.coerce.string(), - duration: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListPagesBuildsResponseValidator(status, body) ctx.status = status return next() } @@ -53848,6 +55462,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposRequestPagesBuildResponseValidator = responseValidationFactory( + [["201", s_page_build_status]], + undefined + ) + router.post( "reposRequestPagesBuild", "/repos/:owner/:repo/pages/builds", @@ -53866,10 +55485,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_page_build_status]], - undefined - )(status, body) + ctx.body = reposRequestPagesBuildResponseValidator(status, body) ctx.status = status return next() } @@ -53880,6 +55496,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetLatestPagesBuildResponseValidator = responseValidationFactory( + [["200", s_page_build]], + undefined + ) + router.get( "reposGetLatestPagesBuild", "/repos/:owner/:repo/pages/builds/latest", @@ -53898,10 +55519,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_page_build]], undefined)( - status, - body - ) + ctx.body = reposGetLatestPagesBuildResponseValidator(status, body) ctx.status = status return next() } @@ -53913,6 +55531,11 @@ export function bootstrap( build_id: z.coerce.number(), }) + const reposGetPagesBuildResponseValidator = responseValidationFactory( + [["200", s_page_build]], + undefined + ) + router.get( "reposGetPagesBuild", "/repos/:owner/:repo/pages/builds/:buildId", @@ -53928,10 +55551,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_page_build]], undefined)( - status, - body - ) + ctx.body = reposGetPagesBuildResponseValidator(status, body) ctx.status = status return next() } @@ -53949,6 +55569,16 @@ export function bootstrap( oidc_token: z.coerce.string(), }) + const reposCreatePagesDeploymentResponseValidator = responseValidationFactory( + [ + ["200", s_page_deployment], + ["400", s_scim_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreatePagesDeployment", "/repos/:owner/:repo/pages/deployment", @@ -53967,15 +55597,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_page_deployment], - ["400", s_scim_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreatePagesDeploymentResponseValidator(status, body) ctx.status = status return next() } @@ -53986,6 +55608,17 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetPagesHealthCheckResponseValidator = responseValidationFactory( + [ + ["200", s_pages_health_check], + ["202", s_empty_object], + ["400", z.void()], + ["404", s_basic_error], + ["422", z.void()], + ], + undefined + ) + router.get( "reposGetPagesHealthCheck", "/repos/:owner/:repo/pages/health", @@ -54004,16 +55637,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pages_health_check], - ["202", s_empty_object], - ["400", z.void()], - ["404", s_basic_error], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = reposGetPagesHealthCheckResponseValidator(status, body) ctx.status = status return next() } @@ -54030,6 +55654,63 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const projectsListForRepoResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.get( "projectsListForRepo", "/repos/:owner/:repo/projects", @@ -54045,62 +55726,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - ), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsListForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -54116,6 +55742,18 @@ export function bootstrap( body: z.coerce.string().optional(), }) + const projectsCreateForRepoResponseValidator = responseValidationFactory( + [ + ["201", s_project], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["410", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "projectsCreateForRepo", "/repos/:owner/:repo/projects", @@ -54131,17 +55769,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_project], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["410", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = projectsCreateForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -54164,866 +55792,278 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get("pullsList", "/repos/:owner/:repo/pulls", async (ctx, next) => { - const input = { - params: parseRequestInput(pullsListParamSchema, ctx.params), - query: parseRequestInput(pullsListQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.pullsList(input, ctx) - - ctx.body = responseValidationFactory( + const pullsListResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), + "200", + z.array( + z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + diff_url: z.coerce.string(), + patch_url: z.coerce.string(), + issue_url: z.coerce.string(), + commits_url: z.coerce.string(), + review_comments_url: z.coerce.string(), + review_comment_url: z.coerce.string(), + comments_url: z.coerce.string(), + statuses_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + locked: z.coerce.boolean(), + title: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), html_url: z.coerce.string(), - diff_url: z.coerce.string(), - patch_url: z.coerce.string(), - issue_url: z.coerce.string(), - commits_url: z.coerce.string(), - review_comments_url: z.coerce.string(), - review_comment_url: z.coerce.string(), - comments_url: z.coerce.string(), - statuses_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - locked: z.coerce.boolean(), - title: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - labels: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - }) - ), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - active_lock_reason: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - merged_at: z.coerce.string().datetime({ offset: true }), - merge_commit_sha: z.coerce.string(), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_reviewers: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - requested_teams: z - .array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ) - .optional(), - head: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }), - sha: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }), - base: z.object({ - label: z.coerce.string(), - ref: z.coerce.string(), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + labels: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + }) + ), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + active_lock_reason: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + merged_at: z.coerce.string().datetime({ offset: true }), + merge_commit_sha: z.coerce.string(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_reviewers: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + requested_teams: z + .array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), }) .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ) + .optional(), + head: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), }), - sha: z.coerce.string(), - user: z.object({ + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -55046,29 +56086,311 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }), - _links: z.object({ - comments: z.object({ href: z.coerce.string() }), - commits: z.object({ href: z.coerce.string() }), - statuses: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - issue: z.object({ href: z.coerce.string() }), - review_comments: z.object({ href: z.coerce.string() }), - review_comment: z.object({ href: z.coerce.string() }), - self: z.object({ href: z.coerce.string() }), + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - auto_merge: z.object({ - enabled_by: z.object({ + }), + base: z.object({ + label: z.coerce.string(), + ref: z.coerce.string(), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -55091,19 +56413,327 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - merge_method: z.enum(["merge", "squash", "rebase"]), - commit_title: z.coerce.string(), - commit_message: z.coerce.string(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }), - draft: z.coerce.boolean().optional(), - }) - ), - ], - ["304", z.void()], - ["422", s_validation_error], + sha: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }), + _links: z.object({ + comments: z.object({ href: z.coerce.string() }), + commits: z.object({ href: z.coerce.string() }), + statuses: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + issue: z.object({ href: z.coerce.string() }), + review_comments: z.object({ href: z.coerce.string() }), + review_comment: z.object({ href: z.coerce.string() }), + self: z.object({ href: z.coerce.string() }), + }), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + auto_merge: z.object({ + enabled_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + merge_method: z.enum(["merge", "squash", "rebase"]), + commit_title: z.coerce.string(), + commit_message: z.coerce.string(), + }), + draft: z.coerce.boolean().optional(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["422", s_validation_error], + ], + undefined + ) + + router.get("pullsList", "/repos/:owner/:repo/pulls", async (ctx, next) => { + const input = { + params: parseRequestInput(pullsListParamSchema, ctx.params), + query: parseRequestInput(pullsListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.pullsList(input, ctx) + + ctx.body = pullsListResponseValidator(status, body) ctx.status = status return next() }) @@ -55123,6 +56753,15 @@ export function bootstrap( issue: z.coerce.number().optional(), }) + const pullsCreateResponseValidator = responseValidationFactory( + [ + ["201", s_pull_request], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post("pullsCreate", "/repos/:owner/:repo/pulls", async (ctx, next) => { const input = { params: parseRequestInput(pullsCreateParamSchema, ctx.params), @@ -55132,14 +56771,7 @@ export function bootstrap( const { status, body } = await implementation.pullsCreate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_pull_request], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = pullsCreateResponseValidator(status, body) ctx.status = status return next() }) @@ -55157,6 +56789,96 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const pullsListReviewCommentsForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "pullsListReviewCommentsForRepo", "/repos/:owner/:repo/pulls/comments", @@ -55176,94 +56898,7 @@ export function bootstrap( const { status, body } = await implementation.pullsListReviewCommentsForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = pullsListReviewCommentsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -55275,6 +56910,14 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const pullsGetReviewCommentResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review_comment], + ["404", s_basic_error], + ], + undefined + ) + router.get( "pullsGetReviewComment", "/repos/:owner/:repo/pulls/comments/:commentId", @@ -55290,13 +56933,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review_comment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = pullsGetReviewCommentResponseValidator(status, body) ctx.status = status return next() } @@ -55312,6 +56949,11 @@ export function bootstrap( body: z.coerce.string(), }) + const pullsUpdateReviewCommentResponseValidator = responseValidationFactory( + [["200", s_pull_request_review_comment]], + undefined + ) + router.patch( "pullsUpdateReviewComment", "/repos/:owner/:repo/pulls/comments/:commentId", @@ -55330,10 +56972,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_pull_request_review_comment]], - undefined - )(status, body) + ctx.body = pullsUpdateReviewCommentResponseValidator(status, body) ctx.status = status return next() } @@ -55345,6 +56984,14 @@ export function bootstrap( comment_id: z.coerce.number(), }) + const pullsDeleteReviewCommentResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "pullsDeleteReviewComment", "/repos/:owner/:repo/pulls/comments/:commentId", @@ -55363,13 +57010,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = pullsDeleteReviewCommentResponseValidator(status, body) ctx.status = status return next() } @@ -55398,6 +57039,57 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForPullRequestReviewCommentResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reactionsListForPullRequestReviewComment", "/repos/:owner/:repo/pulls/comments/:commentId/reactions", @@ -55420,55 +57112,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reactionsListForPullRequestReviewCommentResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -55493,6 +57140,16 @@ export function bootstrap( ]), }) + const reactionsCreateForPullRequestReviewCommentResponseValidator = + responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reactionsCreateForPullRequestReviewComment", "/repos/:owner/:repo/pulls/comments/:commentId/reactions", @@ -55515,14 +57172,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForPullRequestReviewCommentResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -55535,6 +57188,9 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForPullRequestCommentResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reactionsDeleteForPullRequestComment", "/repos/:owner/:repo/pulls/comments/:commentId/reactions/:reactionId", @@ -55551,7 +57207,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsDeleteForPullRequestComment(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = reactionsDeleteForPullRequestCommentResponseValidator( status, body ) @@ -55566,6 +57222,24 @@ export function bootstrap( pull_number: z.coerce.number(), }) + const pullsGetResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request], + ["304", z.void()], + ["404", s_basic_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "pullsGet", "/repos/:owner/:repo/pulls/:pullNumber", @@ -55578,23 +57252,7 @@ export function bootstrap( const { status, body } = await implementation.pullsGet(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request], - ["304", z.void()], - ["404", s_basic_error], - ["500", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = pullsGetResponseValidator(status, body) ctx.status = status return next() } @@ -55616,6 +57274,15 @@ export function bootstrap( }) .optional() + const pullsUpdateResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "pullsUpdate", "/repos/:owner/:repo/pulls/:pullNumber", @@ -55628,14 +57295,7 @@ export function bootstrap( const { status, body } = await implementation.pullsUpdate(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = pullsUpdateResponseValidator(status, body) ctx.status = status return next() } @@ -55659,6 +57319,26 @@ export function bootstrap( retention_period_minutes: z.coerce.number().optional(), }) + const codespacesCreateWithPrForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_codespace], + ["202", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.post( "codespacesCreateWithPrForAuthenticatedUser", "/repos/:owner/:repo/pulls/:pullNumber/codespaces", @@ -55681,24 +57361,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_codespace], - ["202", s_codespace], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codespacesCreateWithPrForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -55718,6 +57384,95 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const pullsListReviewCommentsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "pullsListReviewComments", "/repos/:owner/:repo/pulls/:pullNumber/comments", @@ -55736,94 +57491,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = pullsListReviewCommentsResponseValidator(status, body) ctx.status = status return next() } @@ -55847,6 +57515,15 @@ export function bootstrap( in_reply_to: z.coerce.number().optional(), }) + const pullsCreateReviewCommentResponseValidator = responseValidationFactory( + [ + ["201", s_pull_request_review_comment], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "pullsCreateReviewComment", "/repos/:owner/:repo/pulls/:pullNumber/comments", @@ -55865,14 +57542,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_pull_request_review_comment], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = pullsCreateReviewCommentResponseValidator(status, body) ctx.status = status return next() } @@ -55889,6 +57559,15 @@ export function bootstrap( body: z.coerce.string(), }) + const pullsCreateReplyForReviewCommentResponseValidator = + responseValidationFactory( + [ + ["201", s_pull_request_review_comment], + ["404", s_basic_error], + ], + undefined + ) + router.post( "pullsCreateReplyForReviewComment", "/repos/:owner/:repo/pulls/:pullNumber/comments/:commentId/replies", @@ -55908,13 +57587,7 @@ export function bootstrap( const { status, body } = await implementation.pullsCreateReplyForReviewComment(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_pull_request_review_comment], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = pullsCreateReplyForReviewCommentResponseValidator(status, body) ctx.status = status return next() } @@ -55931,6 +57604,136 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const pullsListCommitsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + url: z.coerce.string(), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + message: z.coerce.string(), + comment_count: z.coerce.number(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string().optional(), + }) + ), + stats: z + .object({ + additions: z.coerce.number().optional(), + deletions: z.coerce.number().optional(), + total: z.coerce.number().optional(), + }) + .optional(), + files: z + .array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "pullsListCommits", "/repos/:owner/:repo/pulls/:pullNumber/commits", @@ -55943,135 +57746,7 @@ export function bootstrap( const { status, body } = await implementation.pullsListCommits(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - sha: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string(), - comments_url: z.coerce.string(), - commit: z.object({ - url: z.coerce.string(), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - message: z.coerce.string(), - comment_count: z.coerce.number(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), - }) - .optional(), - }), - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - parents: z.array( - z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string().optional(), - }) - ), - stats: z - .object({ - additions: z.coerce.number().optional(), - deletions: z.coerce.number().optional(), - total: z.coerce.number().optional(), - }) - .optional(), - files: z - .array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = pullsListCommitsResponseValidator(status, body) ctx.status = status return next() } @@ -56088,6 +57763,48 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const pullsListFilesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + sha: z.coerce.string(), + filename: z.coerce.string(), + status: z.enum([ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged", + ]), + additions: z.coerce.number(), + deletions: z.coerce.number(), + changes: z.coerce.number(), + blob_url: z.coerce.string(), + raw_url: z.coerce.string(), + contents_url: z.coerce.string(), + patch: z.coerce.string().optional(), + previous_filename: z.coerce.string().optional(), + }) + ), + ], + ["422", s_validation_error], + ["500", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "pullsListFiles", "/repos/:owner/:repo/pulls/:pullNumber/files", @@ -56100,47 +57817,7 @@ export function bootstrap( const { status, body } = await implementation.pullsListFiles(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - sha: z.coerce.string(), - filename: z.coerce.string(), - status: z.enum([ - "added", - "removed", - "modified", - "renamed", - "copied", - "changed", - "unchanged", - ]), - additions: z.coerce.number(), - deletions: z.coerce.number(), - changes: z.coerce.number(), - blob_url: z.coerce.string(), - raw_url: z.coerce.string(), - contents_url: z.coerce.string(), - patch: z.coerce.string().optional(), - previous_filename: z.coerce.string().optional(), - }) - ), - ], - ["422", s_validation_error], - ["500", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = pullsListFilesResponseValidator(status, body) ctx.status = status return next() } @@ -56152,6 +57829,14 @@ export function bootstrap( pull_number: z.coerce.number(), }) + const pullsCheckIfMergedResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "pullsCheckIfMerged", "/repos/:owner/:repo/pulls/:pullNumber/merge", @@ -56167,13 +57852,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = pullsCheckIfMergedResponseValidator(status, body) ctx.status = status return next() } @@ -56194,6 +57873,30 @@ export function bootstrap( }) .optional() + const pullsMergeResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_merge_result], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "405", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + [ + "409", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["422", s_validation_error], + ], + undefined + ) + router.put( "pullsMerge", "/repos/:owner/:repo/pulls/:pullNumber/merge", @@ -56206,29 +57909,7 @@ export function bootstrap( const { status, body } = await implementation.pullsMerge(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_merge_result], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "405", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - [ - "409", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = pullsMergeResponseValidator(status, body) ctx.status = status return next() } @@ -56240,6 +57921,12 @@ export function bootstrap( pull_number: z.coerce.number(), }) + const pullsListRequestedReviewersResponseValidator = + responseValidationFactory( + [["200", s_pull_request_review_request]], + undefined + ) + router.get( "pullsListRequestedReviewers", "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", @@ -56258,10 +57945,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_pull_request_review_request]], - undefined - )(status, body) + ctx.body = pullsListRequestedReviewersResponseValidator(status, body) ctx.status = status return next() } @@ -56280,6 +57964,15 @@ export function bootstrap( }) .optional() + const pullsRequestReviewersResponseValidator = responseValidationFactory( + [ + ["201", s_pull_request_simple], + ["403", s_basic_error], + ["422", z.void()], + ], + undefined + ) + router.post( "pullsRequestReviewers", "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", @@ -56295,14 +57988,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_pull_request_simple], - ["403", s_basic_error], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = pullsRequestReviewersResponseValidator(status, body) ctx.status = status return next() } @@ -56319,6 +58005,15 @@ export function bootstrap( team_reviewers: z.array(z.coerce.string()).optional(), }) + const pullsRemoveRequestedReviewersResponseValidator = + responseValidationFactory( + [ + ["200", s_pull_request_simple], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "pullsRemoveRequestedReviewers", "/repos/:owner/:repo/pulls/:pullNumber/requested_reviewers", @@ -56338,13 +58033,7 @@ export function bootstrap( const { status, body } = await implementation.pullsRemoveRequestedReviewers(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_simple], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = pullsRemoveRequestedReviewersResponseValidator(status, body) ctx.status = status return next() } @@ -56361,6 +58050,69 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const pullsListReviewsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + state: z.coerce.string(), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + _links: z.object({ + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + submitted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + commit_id: z.coerce.string(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + }) + ), + ], + ], + undefined + ) + router.get( "pullsListReviews", "/repos/:owner/:repo/pulls/:pullNumber/reviews", @@ -56373,68 +58125,7 @@ export function bootstrap( const { status, body } = await implementation.pullsListReviews(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - state: z.coerce.string(), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - _links: z.object({ - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - submitted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - commit_id: z.coerce.string(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = pullsListReviewsResponseValidator(status, body) ctx.status = status return next() } @@ -56467,6 +58158,15 @@ export function bootstrap( }) .optional() + const pullsCreateReviewResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["403", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "pullsCreateReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews", @@ -56482,14 +58182,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review], - ["403", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = pullsCreateReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56502,6 +58195,14 @@ export function bootstrap( review_id: z.coerce.number(), }) + const pullsGetReviewResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["404", s_basic_error], + ], + undefined + ) + router.get( "pullsGetReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", @@ -56514,13 +58215,7 @@ export function bootstrap( const { status, body } = await implementation.pullsGetReview(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = pullsGetReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56535,6 +58230,14 @@ export function bootstrap( const pullsUpdateReviewBodySchema = z.object({ body: z.coerce.string() }) + const pullsUpdateReviewResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "pullsUpdateReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", @@ -56550,13 +58253,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = pullsUpdateReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56569,6 +58266,15 @@ export function bootstrap( review_id: z.coerce.number(), }) + const pullsDeletePendingReviewResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.delete( "pullsDeletePendingReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId", @@ -56587,14 +58293,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = pullsDeletePendingReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56612,6 +58311,96 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const pullsListCommentsForReviewResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + pull_request_review_id: z.coerce.number(), + id: z.coerce.number(), + node_id: z.coerce.string(), + diff_hunk: z.coerce.string(), + path: z.coerce.string(), + position: z.coerce.number(), + original_position: z.coerce.number(), + commit_id: z.coerce.string(), + original_commit_id: z.coerce.string(), + in_reply_to_id: z.coerce.number().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + pull_request_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + _links: z.object({ + self: z.object({ href: z.coerce.string() }), + html: z.object({ href: z.coerce.string() }), + pull_request: z.object({ href: z.coerce.string() }), + }), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + side: z.enum(["LEFT", "RIGHT"]).optional(), + start_side: z.enum(["LEFT", "RIGHT"]).optional(), + line: z.coerce.number().optional(), + original_line: z.coerce.number().optional(), + start_line: z.coerce.number().optional(), + original_start_line: z.coerce.number().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "pullsListCommentsForReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/comments", @@ -56633,95 +58422,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - pull_request_review_id: z.coerce.number(), - id: z.coerce.number(), - node_id: z.coerce.string(), - diff_hunk: z.coerce.string(), - path: z.coerce.string(), - position: z.coerce.number(), - original_position: z.coerce.number(), - commit_id: z.coerce.string(), - original_commit_id: z.coerce.string(), - in_reply_to_id: z.coerce.number().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - pull_request_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - _links: z.object({ - self: z.object({ href: z.coerce.string() }), - html: z.object({ href: z.coerce.string() }), - pull_request: z.object({ href: z.coerce.string() }), - }), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - side: z.enum(["LEFT", "RIGHT"]).optional(), - start_side: z.enum(["LEFT", "RIGHT"]).optional(), - line: z.coerce.number().optional(), - original_line: z.coerce.number().optional(), - start_line: z.coerce.number().optional(), - original_start_line: z.coerce.number().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = pullsListCommentsForReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56739,6 +58440,15 @@ export function bootstrap( event: z.enum(["DISMISS"]).optional(), }) + const pullsDismissReviewResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "pullsDismissReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/dismissals", @@ -56754,14 +58464,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = pullsDismissReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56779,6 +58482,16 @@ export function bootstrap( event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), }) + const pullsSubmitReviewResponseValidator = responseValidationFactory( + [ + ["200", s_pull_request_review], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( "pullsSubmitReview", "/repos/:owner/:repo/pulls/:pullNumber/reviews/:reviewId/events", @@ -56794,15 +58507,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_pull_request_review], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = pullsSubmitReviewResponseValidator(status, body) ctx.status = status return next() } @@ -56818,6 +58523,21 @@ export function bootstrap( .object({ expected_head_sha: z.coerce.string().optional() }) .optional() + const pullsUpdateBranchResponseValidator = responseValidationFactory( + [ + [ + "202", + z.object({ + message: z.coerce.string().optional(), + url: z.coerce.string().optional(), + }), + ], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "pullsUpdateBranch", "/repos/:owner/:repo/pulls/:pullNumber/update-branch", @@ -56833,20 +58553,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "202", - z.object({ - message: z.coerce.string().optional(), - url: z.coerce.string().optional(), - }), - ], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = pullsUpdateBranchResponseValidator(status, body) ctx.status = status return next() } @@ -56861,6 +58568,15 @@ export function bootstrap( ref: z.coerce.string().optional(), }) + const reposGetReadmeResponseValidator = responseValidationFactory( + [ + ["200", s_content_file], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "reposGetReadme", "/repos/:owner/:repo/readme", @@ -56873,14 +58589,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetReadme(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_content_file], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposGetReadmeResponseValidator(status, body) ctx.status = status return next() } @@ -56896,6 +58605,15 @@ export function bootstrap( ref: z.coerce.string().optional(), }) + const reposGetReadmeInDirectoryResponseValidator = responseValidationFactory( + [ + ["200", s_content_file], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "reposGetReadmeInDirectory", "/repos/:owner/:repo/readme/:dir", @@ -56917,14 +58635,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_content_file], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposGetReadmeInDirectoryResponseValidator(status, body) ctx.status = status return next() } @@ -56940,44 +58651,66 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "reposListReleases", - "/repos/:owner/:repo/releases", - async (ctx, next) => { - const input = { - params: parseRequestInput(reposListReleasesParamSchema, ctx.params), - query: parseRequestInput(reposListReleasesQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListReleases( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( + const reposListReleasesResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + assets_url: z.coerce.string(), + upload_url: z.coerce.string(), + tarball_url: z.coerce.string(), + zipball_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + tag_name: z.coerce.string(), + target_commitish: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string().optional(), + draft: z.coerce.boolean(), + prerelease: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + published_at: z.coerce.string().datetime({ offset: true }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assets: z.array( z.object({ url: z.coerce.string(), - html_url: z.coerce.string(), - assets_url: z.coerce.string(), - upload_url: z.coerce.string(), - tarball_url: z.coerce.string(), - zipball_url: z.coerce.string(), + browser_download_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - tag_name: z.coerce.string(), - target_commitish: z.coerce.string(), name: z.coerce.string(), - body: z.coerce.string().optional(), - draft: z.coerce.boolean(), - prerelease: z.coerce.boolean(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), - published_at: z.coerce.string().datetime({ offset: true }), - author: z.object({ + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -57000,70 +58733,50 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - assets: z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - mentions_count: z.coerce.number().optional(), - discussion_url: z.coerce.string().optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), }) ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + mentions_count: z.coerce.number().optional(), + discussion_url: z.coerce.string().optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "reposListReleases", + "/repos/:owner/:repo/releases", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListReleasesParamSchema, ctx.params), + query: parseRequestInput(reposListReleasesQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListReleases( + input, + ctx + ) + + ctx.body = reposListReleasesResponseValidator(status, body) ctx.status = status return next() } @@ -57086,6 +58799,15 @@ export function bootstrap( make_latest: z.enum(["true", "false", "legacy"]).optional(), }) + const reposCreateReleaseResponseValidator = responseValidationFactory( + [ + ["201", s_release], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reposCreateRelease", "/repos/:owner/:repo/releases", @@ -57101,14 +58823,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_release], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposCreateReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57120,6 +58835,15 @@ export function bootstrap( asset_id: z.coerce.number(), }) + const reposGetReleaseAssetResponseValidator = responseValidationFactory( + [ + ["200", s_release_asset], + ["302", z.void()], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetReleaseAsset", "/repos/:owner/:repo/releases/assets/:assetId", @@ -57135,14 +58859,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_release_asset], - ["302", z.void()], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetReleaseAssetResponseValidator(status, body) ctx.status = status return next() } @@ -57162,6 +58879,11 @@ export function bootstrap( }) .optional() + const reposUpdateReleaseAssetResponseValidator = responseValidationFactory( + [["200", s_release_asset]], + undefined + ) + router.patch( "reposUpdateReleaseAsset", "/repos/:owner/:repo/releases/assets/:assetId", @@ -57180,10 +58902,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_release_asset]], - undefined - )(status, body) + ctx.body = reposUpdateReleaseAssetResponseValidator(status, body) ctx.status = status return next() } @@ -57195,6 +58914,11 @@ export function bootstrap( asset_id: z.coerce.number(), }) + const reposDeleteReleaseAssetResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposDeleteReleaseAsset", "/repos/:owner/:repo/releases/assets/:assetId", @@ -57213,10 +58937,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDeleteReleaseAssetResponseValidator(status, body) ctx.status = status return next() } @@ -57234,6 +58955,14 @@ export function bootstrap( configuration_file_path: z.coerce.string().optional(), }) + const reposGenerateReleaseNotesResponseValidator = responseValidationFactory( + [ + ["200", s_release_notes_content], + ["404", s_basic_error], + ], + undefined + ) + router.post( "reposGenerateReleaseNotes", "/repos/:owner/:repo/releases/generate-notes", @@ -57252,13 +58981,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_release_notes_content], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGenerateReleaseNotesResponseValidator(status, body) ctx.status = status return next() } @@ -57269,6 +58992,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetLatestReleaseResponseValidator = responseValidationFactory( + [["200", s_release]], + undefined + ) + router.get( "reposGetLatestRelease", "/repos/:owner/:repo/releases/latest", @@ -57284,10 +59012,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_release]], undefined)( - status, - body - ) + ctx.body = reposGetLatestReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57299,6 +59024,14 @@ export function bootstrap( tag: z.coerce.string(), }) + const reposGetReleaseByTagResponseValidator = responseValidationFactory( + [ + ["200", s_release], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetReleaseByTag", "/repos/:owner/:repo/releases/tags/:tag", @@ -57313,14 +59046,8 @@ export function bootstrap( input, ctx ) - - ctx.body = responseValidationFactory( - [ - ["200", s_release], - ["404", s_basic_error], - ], - undefined - )(status, body) + + ctx.body = reposGetReleaseByTagResponseValidator(status, body) ctx.status = status return next() } @@ -57332,6 +59059,14 @@ export function bootstrap( release_id: z.coerce.number(), }) + const reposGetReleaseResponseValidator = responseValidationFactory( + [ + ["200", s_release], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetRelease", "/repos/:owner/:repo/releases/:releaseId", @@ -57344,13 +59079,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetRelease(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_release], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57375,6 +59104,14 @@ export function bootstrap( }) .optional() + const reposUpdateReleaseResponseValidator = responseValidationFactory( + [ + ["200", s_release], + ["404", s_basic_error], + ], + undefined + ) + router.patch( "reposUpdateRelease", "/repos/:owner/:repo/releases/:releaseId", @@ -57390,13 +59127,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_release], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposUpdateReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57408,6 +59139,11 @@ export function bootstrap( release_id: z.coerce.number(), }) + const reposDeleteReleaseResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reposDeleteRelease", "/repos/:owner/:repo/releases/:releaseId", @@ -57423,10 +59159,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDeleteReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57443,6 +59176,54 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListReleaseAssetsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + browser_download_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + label: z.coerce.string(), + state: z.enum(["uploaded", "open"]), + content_type: z.coerce.string(), + size: z.coerce.number(), + download_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + uploader: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + }) + ), + ], + ], + undefined + ) + router.get( "reposListReleaseAssets", "/repos/:owner/:repo/releases/:releaseId/assets", @@ -57461,53 +59242,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - browser_download_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - label: z.coerce.string(), - state: z.enum(["uploaded", "open"]), - content_type: z.coerce.string(), - size: z.coerce.number(), - download_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - uploader: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListReleaseAssetsResponseValidator(status, body) ctx.status = status return next() } @@ -57526,6 +59261,14 @@ export function bootstrap( const reposUploadReleaseAssetBodySchema = z.coerce.string().optional() + const reposUploadReleaseAssetResponseValidator = responseValidationFactory( + [ + ["201", s_release_asset], + ["422", z.void()], + ], + undefined + ) + router.post( "reposUploadReleaseAsset", "/repos/:owner/:repo/releases/:releaseId/assets", @@ -57544,13 +59287,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_release_asset], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = reposUploadReleaseAssetResponseValidator(status, body) ctx.status = status return next() } @@ -57570,6 +59307,56 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForReleaseResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reactionsListForRelease", "/repos/:owner/:repo/releases/:releaseId/reactions", @@ -57588,55 +59375,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reactionsListForReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57652,6 +59391,15 @@ export function bootstrap( content: z.enum(["+1", "laugh", "heart", "hooray", "rocket", "eyes"]), }) + const reactionsCreateForReleaseResponseValidator = responseValidationFactory( + [ + ["200", s_reaction], + ["201", s_reaction], + ["422", s_validation_error], + ], + undefined + ) + router.post( "reactionsCreateForRelease", "/repos/:owner/:repo/releases/:releaseId/reactions", @@ -57670,14 +59418,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_reaction], - ["201", s_reaction], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reactionsCreateForReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57690,6 +59431,11 @@ export function bootstrap( reaction_id: z.coerce.number(), }) + const reactionsDeleteForReleaseResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "reactionsDeleteForRelease", "/repos/:owner/:repo/releases/:releaseId/reactions/:reactionId", @@ -57708,10 +59454,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reactionsDeleteForReleaseResponseValidator(status, body) ctx.status = status return next() } @@ -57734,6 +59477,114 @@ export function bootstrap( after: z.coerce.string().optional(), }) + const secretScanningListAlertsForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + number: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + locations_url: z.coerce.string().optional(), + state: z.enum(["open", "resolved"]).optional(), + resolution: z + .enum([ + "null", + "false_positive", + "wont_fix", + "revoked", + "used_in_tests", + ]) + .optional(), + resolved_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + resolved_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + resolution_comment: z.coerce.string().optional(), + secret_type: z.coerce.string().optional(), + secret_type_display_name: z.coerce.string().optional(), + secret: z.coerce.string().optional(), + push_protection_bypassed: z.coerce.boolean().optional(), + push_protection_bypassed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + push_protection_bypassed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "secretScanningListAlertsForRepo", "/repos/:owner/:repo/secret-scanning/alerts", @@ -57753,112 +59604,7 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListAlertsForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - number: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - locations_url: z.coerce.string().optional(), - state: z.enum(["open", "resolved"]).optional(), - resolution: z - .enum([ - "null", - "false_positive", - "wont_fix", - "revoked", - "used_in_tests", - ]) - .optional(), - resolved_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - resolved_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - resolution_comment: z.coerce.string().optional(), - secret_type: z.coerce.string().optional(), - secret_type_display_name: z.coerce.string().optional(), - secret: z.coerce.string().optional(), - push_protection_bypassed: z.coerce.boolean().optional(), - push_protection_bypassed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - push_protection_bypassed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - ], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = secretScanningListAlertsForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -57870,6 +59616,23 @@ export function bootstrap( alert_number: z.coerce.number(), }) + const secretScanningGetAlertResponseValidator = responseValidationFactory( + [ + ["200", s_secret_scanning_alert], + ["304", z.void()], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "secretScanningGetAlert", "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", @@ -57888,22 +59651,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_secret_scanning_alert], - ["304", z.void()], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = secretScanningGetAlertResponseValidator(status, body) ctx.status = status return next() } @@ -57923,6 +59671,24 @@ export function bootstrap( resolution_comment: z.coerce.string().optional(), }) + const secretScanningUpdateAlertResponseValidator = responseValidationFactory( + [ + ["200", s_secret_scanning_alert], + ["400", z.void()], + ["404", z.void()], + ["422", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.patch( "secretScanningUpdateAlert", "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber", @@ -57941,23 +59707,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_secret_scanning_alert], - ["400", z.void()], - ["404", z.void()], - ["422", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = secretScanningUpdateAlertResponseValidator(status, body) ctx.status = status return next() } @@ -57974,6 +59724,41 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const secretScanningListLocationsForAlertResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + type: z.enum([ + "commit", + "issue_title", + "issue_body", + "issue_comment", + ]), + details: z.union([ + s_secret_scanning_location_commit, + s_secret_scanning_location_issue_title, + s_secret_scanning_location_issue_body, + s_secret_scanning_location_issue_comment, + ]), + }) + ), + ], + ["404", z.void()], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get( "secretScanningListLocationsForAlert", "/repos/:owner/:repo/secret-scanning/alerts/:alertNumber/locations", @@ -57993,39 +59778,10 @@ export function bootstrap( const { status, body } = await implementation.secretScanningListLocationsForAlert(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - type: z.enum([ - "commit", - "issue_title", - "issue_body", - "issue_comment", - ]), - details: z.union([ - s_secret_scanning_location_commit, - s_secret_scanning_location_issue_title, - s_secret_scanning_location_issue_body, - s_secret_scanning_location_issue_comment, - ]), - }) - ), - ], - ["404", z.void()], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = secretScanningListLocationsForAlertResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -58041,6 +59797,15 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const activityListStargazersForRepoResponseValidator = + responseValidationFactory( + [ + ["200", z.object({})], + ["422", s_validation_error], + ], + undefined + ) + router.get( "activityListStargazersForRepo", "/repos/:owner/:repo/stargazers", @@ -58060,13 +59825,7 @@ export function bootstrap( const { status, body } = await implementation.activityListStargazersForRepo(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.object({})], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = activityListStargazersForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -58077,6 +59836,15 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetCodeFrequencyStatsResponseValidator = responseValidationFactory( + [ + ["200", z.array(z.array(z.coerce.number()))], + ["202", z.object({})], + ["204", z.void()], + ], + undefined + ) + router.get( "reposGetCodeFrequencyStats", "/repos/:owner/:repo/stats/code_frequency", @@ -58095,14 +59863,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.array(z.coerce.number()))], - ["202", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = reposGetCodeFrequencyStatsResponseValidator(status, body) ctx.status = status return next() } @@ -58113,6 +59874,25 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetCommitActivityStatsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + days: z.array(z.coerce.number()), + total: z.coerce.number(), + week: z.coerce.number(), + }) + ), + ], + ["202", z.object({})], + ["204", z.void()], + ], + undefined + ) + router.get( "reposGetCommitActivityStats", "/repos/:owner/:repo/stats/commit_activity", @@ -58131,23 +59911,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - days: z.array(z.coerce.number()), - total: z.coerce.number(), - week: z.coerce.number(), - }) - ), - ], - ["202", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = reposGetCommitActivityStatsResponseValidator(status, body) ctx.status = status return next() } @@ -58158,6 +59922,53 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetContributorsStatsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + total: z.coerce.number(), + weeks: z.array( + z.object({ + w: z.coerce.number().optional(), + a: z.coerce.number().optional(), + d: z.coerce.number().optional(), + c: z.coerce.number().optional(), + }) + ), + }) + ), + ], + ["202", z.object({})], + ["204", z.void()], + ], + undefined + ) + router.get( "reposGetContributorsStats", "/repos/:owner/:repo/stats/contributors", @@ -58176,52 +59987,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - total: z.coerce.number(), - weeks: z.array( - z.object({ - w: z.coerce.number().optional(), - a: z.coerce.number().optional(), - d: z.coerce.number().optional(), - c: z.coerce.number().optional(), - }) - ), - }) - ), - ], - ["202", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = reposGetContributorsStatsResponseValidator(status, body) ctx.status = status return next() } @@ -58232,6 +59998,14 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetParticipationStatsResponseValidator = responseValidationFactory( + [ + ["200", s_participation_stats], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetParticipationStats", "/repos/:owner/:repo/stats/participation", @@ -58250,13 +60024,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_participation_stats], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetParticipationStatsResponseValidator(status, body) ctx.status = status return next() } @@ -58267,6 +60035,14 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetPunchCardStatsResponseValidator = responseValidationFactory( + [ + ["200", z.array(z.array(z.coerce.number()))], + ["204", z.void()], + ], + undefined + ) + router.get( "reposGetPunchCardStats", "/repos/:owner/:repo/stats/punch_card", @@ -58285,13 +60061,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.array(z.coerce.number()))], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = reposGetPunchCardStatsResponseValidator(status, body) ctx.status = status return next() } @@ -58310,6 +60080,11 @@ export function bootstrap( context: z.coerce.string().optional(), }) + const reposCreateCommitStatusResponseValidator = responseValidationFactory( + [["201", s_status]], + undefined + ) + router.post( "reposCreateCommitStatus", "/repos/:owner/:repo/statuses/:sha", @@ -58328,10 +60103,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["201", s_status]], undefined)( - status, - body - ) + ctx.body = reposCreateCommitStatusResponseValidator(status, body) ctx.status = status return next() } @@ -58347,6 +60119,41 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const activityListWatchersForRepoResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "activityListWatchersForRepo", "/repos/:owner/:repo/subscribers", @@ -58368,39 +60175,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = activityListWatchersForRepoResponseValidator(status, body) ctx.status = status return next() } @@ -58411,6 +60186,16 @@ export function bootstrap( repo: z.coerce.string(), }) + const activityGetRepoSubscriptionResponseValidator = + responseValidationFactory( + [ + ["200", s_repository_subscription], + ["403", s_basic_error], + ["404", z.void()], + ], + undefined + ) + router.get( "activityGetRepoSubscription", "/repos/:owner/:repo/subscription", @@ -58429,14 +60214,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_repository_subscription], - ["403", s_basic_error], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = activityGetRepoSubscriptionResponseValidator(status, body) ctx.status = status return next() } @@ -58454,6 +60232,9 @@ export function bootstrap( }) .optional() + const activitySetRepoSubscriptionResponseValidator = + responseValidationFactory([["200", s_repository_subscription]], undefined) + router.put( "activitySetRepoSubscription", "/repos/:owner/:repo/subscription", @@ -58475,10 +60256,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_repository_subscription]], - undefined - )(status, body) + ctx.body = activitySetRepoSubscriptionResponseValidator(status, body) ctx.status = status return next() } @@ -58489,6 +60267,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const activityDeleteRepoSubscriptionResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "activityDeleteRepoSubscription", "/repos/:owner/:repo/subscription", @@ -58505,10 +60286,7 @@ export function bootstrap( const { status, body } = await implementation.activityDeleteRepoSubscription(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = activityDeleteRepoSubscriptionResponseValidator(status, body) ctx.status = status return next() } @@ -58524,6 +60302,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListTagsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string(), + commit: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + zipball_url: z.coerce.string(), + tarball_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ), + ], + ], + undefined + ) + router.get("reposListTags", "/repos/:owner/:repo/tags", async (ctx, next) => { const input = { params: parseRequestInput(reposListTagsParamSchema, ctx.params), @@ -58533,26 +60332,7 @@ export function bootstrap( const { status, body } = await implementation.reposListTags(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string(), - commit: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - zipball_url: z.coerce.string(), - tarball_url: z.coerce.string(), - node_id: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListTagsResponseValidator(status, body) ctx.status = status return next() }) @@ -58562,6 +60342,26 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposListTagProtectionResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + enabled: z.coerce.boolean().optional(), + pattern: z.coerce.string(), + }) + ), + ], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposListTagProtection", "/repos/:owner/:repo/tags/protection", @@ -58580,25 +60380,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - enabled: z.coerce.boolean().optional(), - pattern: z.coerce.string(), - }) - ), - ], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposListTagProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -58613,6 +60395,15 @@ export function bootstrap( pattern: z.coerce.string(), }) + const reposCreateTagProtectionResponseValidator = responseValidationFactory( + [ + ["201", s_tag_protection], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "reposCreateTagProtection", "/repos/:owner/:repo/tags/protection", @@ -58631,14 +60422,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_tag_protection], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposCreateTagProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -58650,6 +60434,15 @@ export function bootstrap( tag_protection_id: z.coerce.number(), }) + const reposDeleteTagProtectionResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "reposDeleteTagProtection", "/repos/:owner/:repo/tags/protection/:tagProtectionId", @@ -58668,14 +60461,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeleteTagProtectionResponseValidator(status, body) ctx.status = status return next() } @@ -58687,6 +60473,9 @@ export function bootstrap( ref: z.coerce.string(), }) + const reposDownloadTarballArchiveResponseValidator = + responseValidationFactory([["302", z.void()]], undefined) + router.get( "reposDownloadTarballArchive", "/repos/:owner/:repo/tarball/:ref", @@ -58705,10 +60494,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDownloadTarballArchiveResponseValidator(status, body) ctx.status = status return next() } @@ -58724,6 +60510,53 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reposListTeamsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ], + undefined + ) + router.get( "reposListTeams", "/repos/:owner/:repo/teams", @@ -58736,52 +60569,7 @@ export function bootstrap( const { status, body } = await implementation.reposListTeams(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reposListTeamsResponseValidator(status, body) ctx.status = status return next() } @@ -58797,6 +60585,14 @@ export function bootstrap( per_page: z.coerce.number().optional(), }) + const reposGetAllTopicsResponseValidator = responseValidationFactory( + [ + ["200", s_topic], + ["404", s_basic_error], + ], + undefined + ) + router.get( "reposGetAllTopics", "/repos/:owner/:repo/topics", @@ -58812,13 +60608,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_topic], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetAllTopicsResponseValidator(status, body) ctx.status = status return next() } @@ -58833,6 +60623,15 @@ export function bootstrap( names: z.array(z.coerce.string()), }) + const reposReplaceAllTopicsResponseValidator = responseValidationFactory( + [ + ["200", s_topic], + ["404", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.put( "reposReplaceAllTopics", "/repos/:owner/:repo/topics", @@ -58848,14 +60647,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_topic], - ["404", s_basic_error], - ["422", s_validation_error_simple], - ], - undefined - )(status, body) + ctx.body = reposReplaceAllTopicsResponseValidator(status, body) ctx.status = status return next() } @@ -58870,6 +60662,14 @@ export function bootstrap( per: z.enum(["", "day", "week"]).optional(), }) + const reposGetClonesResponseValidator = responseValidationFactory( + [ + ["200", s_clone_traffic], + ["403", s_basic_error], + ], + undefined + ) + router.get( "reposGetClones", "/repos/:owner/:repo/traffic/clones", @@ -58882,13 +60682,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetClones(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_clone_traffic], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetClonesResponseValidator(status, body) ctx.status = status return next() } @@ -58899,6 +60693,24 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetTopPathsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + path: z.coerce.string(), + title: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), + }) + ), + ], + ["403", s_basic_error], + ], + undefined + ) + router.get( "reposGetTopPaths", "/repos/:owner/:repo/traffic/popular/paths", @@ -58911,23 +60723,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetTopPaths(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - path: z.coerce.string(), - title: z.coerce.string(), - count: z.coerce.number(), - uniques: z.coerce.number(), - }) - ), - ], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetTopPathsResponseValidator(status, body) ctx.status = status return next() } @@ -58938,6 +60734,23 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposGetTopReferrersResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + referrer: z.coerce.string(), + count: z.coerce.number(), + uniques: z.coerce.number(), + }) + ), + ], + ["403", s_basic_error], + ], + undefined + ) + router.get( "reposGetTopReferrers", "/repos/:owner/:repo/traffic/popular/referrers", @@ -58953,22 +60766,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - referrer: z.coerce.string(), - count: z.coerce.number(), - uniques: z.coerce.number(), - }) - ), - ], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetTopReferrersResponseValidator(status, body) ctx.status = status return next() } @@ -58983,6 +60781,14 @@ export function bootstrap( per: z.enum(["", "day", "week"]).optional(), }) + const reposGetViewsResponseValidator = responseValidationFactory( + [ + ["200", s_view_traffic], + ["403", s_basic_error], + ], + undefined + ) + router.get( "reposGetViews", "/repos/:owner/:repo/traffic/views", @@ -58995,13 +60801,7 @@ export function bootstrap( const { status, body } = await implementation.reposGetViews(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_view_traffic], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposGetViewsResponseValidator(status, body) ctx.status = status return next() } @@ -59018,6 +60818,11 @@ export function bootstrap( team_ids: z.array(z.coerce.number()).optional(), }) + const reposTransferResponseValidator = responseValidationFactory( + [["202", s_minimal_repository]], + undefined + ) + router.post( "reposTransfer", "/repos/:owner/:repo/transfer", @@ -59030,10 +60835,7 @@ export function bootstrap( const { status, body } = await implementation.reposTransfer(input, ctx) - ctx.body = responseValidationFactory( - [["202", s_minimal_repository]], - undefined - )(status, body) + ctx.body = reposTransferResponseValidator(status, body) ctx.status = status return next() } @@ -59044,6 +60846,15 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposCheckVulnerabilityAlertsResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "reposCheckVulnerabilityAlerts", "/repos/:owner/:repo/vulnerability-alerts", @@ -59060,13 +60871,7 @@ export function bootstrap( const { status, body } = await implementation.reposCheckVulnerabilityAlerts(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = reposCheckVulnerabilityAlertsResponseValidator(status, body) ctx.status = status return next() } @@ -59077,6 +60882,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposEnableVulnerabilityAlertsResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.put( "reposEnableVulnerabilityAlerts", "/repos/:owner/:repo/vulnerability-alerts", @@ -59093,10 +60901,7 @@ export function bootstrap( const { status, body } = await implementation.reposEnableVulnerabilityAlerts(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposEnableVulnerabilityAlertsResponseValidator(status, body) ctx.status = status return next() } @@ -59107,6 +60912,9 @@ export function bootstrap( repo: z.coerce.string(), }) + const reposDisableVulnerabilityAlertsResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "reposDisableVulnerabilityAlerts", "/repos/:owner/:repo/vulnerability-alerts", @@ -59123,10 +60931,7 @@ export function bootstrap( const { status, body } = await implementation.reposDisableVulnerabilityAlerts(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDisableVulnerabilityAlertsResponseValidator(status, body) ctx.status = status return next() } @@ -59138,6 +60943,9 @@ export function bootstrap( ref: z.coerce.string(), }) + const reposDownloadZipballArchiveResponseValidator = + responseValidationFactory([["302", z.void()]], undefined) + router.get( "reposDownloadZipballArchive", "/repos/:owner/:repo/zipball/:ref", @@ -59156,10 +60964,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["302", z.void()]], undefined)( - status, - body - ) + ctx.body = reposDownloadZipballArchiveResponseValidator(status, body) ctx.status = status return next() } @@ -59178,6 +60983,11 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) + const reposCreateUsingTemplateResponseValidator = responseValidationFactory( + [["201", s_repository]], + undefined + ) + router.post( "reposCreateUsingTemplate", "/repos/:templateOwner/:templateRepo/generate", @@ -59187,28 +60997,191 @@ export function bootstrap( reposCreateUsingTemplateParamSchema, ctx.params ), - query: undefined, - body: parseRequestInput(reposCreateUsingTemplateBodySchema, ctx.body), - } - - const { status, body } = await implementation.reposCreateUsingTemplate( - input, - ctx - ) - - ctx.body = responseValidationFactory([["201", s_repository]], undefined)( - status, - body - ) - ctx.status = status - return next() - } + query: undefined, + body: parseRequestInput(reposCreateUsingTemplateBodySchema, ctx.body), + } + + const { status, body } = await implementation.reposCreateUsingTemplate( + input, + ctx + ) + + ctx.body = reposCreateUsingTemplateResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposListPublicQuerySchema = z.object({ + since: z.coerce.number().optional(), + }) + + const reposListPublicResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ["304", z.void()], + ["422", s_validation_error], + ], + undefined ) - const reposListPublicQuerySchema = z.object({ - since: z.coerce.number().optional(), - }) - router.get("reposListPublic", "/repositories", async (ctx, next) => { const input = { params: undefined, @@ -59218,180 +61191,7 @@ export function bootstrap( const { status, body } = await implementation.reposListPublic(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ["304", z.void()], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = reposListPublicResponseValidator(status, body) ctx.status = status return next() }) @@ -59406,6 +61206,26 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListEnvironmentSecretsResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListEnvironmentSecrets", "/repositories/:repositoryId/environments/:environmentName/secrets", @@ -59425,24 +61245,7 @@ export function bootstrap( const { status, body } = await implementation.actionsListEnvironmentSecrets(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListEnvironmentSecretsResponseValidator(status, body) ctx.status = status return next() } @@ -59453,6 +61256,9 @@ export function bootstrap( environment_name: z.coerce.string(), }) + const actionsGetEnvironmentPublicKeyResponseValidator = + responseValidationFactory([["200", s_actions_public_key]], undefined) + router.get( "actionsGetEnvironmentPublicKey", "/repositories/:repositoryId/environments/:environmentName/secrets/public-key", @@ -59469,10 +61275,7 @@ export function bootstrap( const { status, body } = await implementation.actionsGetEnvironmentPublicKey(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_actions_public_key]], - undefined - )(status, body) + ctx.body = actionsGetEnvironmentPublicKeyResponseValidator(status, body) ctx.status = status return next() } @@ -59484,6 +61287,9 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const actionsGetEnvironmentSecretResponseValidator = + responseValidationFactory([["200", s_actions_secret]], undefined) + router.get( "actionsGetEnvironmentSecret", "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", @@ -59502,10 +61308,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_actions_secret]], - undefined - )(status, body) + ctx.body = actionsGetEnvironmentSecretResponseValidator(status, body) ctx.status = status return next() } @@ -59522,6 +61325,15 @@ export function bootstrap( key_id: z.coerce.string(), }) + const actionsCreateOrUpdateEnvironmentSecretResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ], + undefined + ) + router.put( "actionsCreateOrUpdateEnvironmentSecret", "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", @@ -59541,13 +61353,10 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateOrUpdateEnvironmentSecret(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_empty_object], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = actionsCreateOrUpdateEnvironmentSecretResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -59559,6 +61368,9 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const actionsDeleteEnvironmentSecretResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "actionsDeleteEnvironmentSecret", "/repositories/:repositoryId/environments/:environmentName/secrets/:secretName", @@ -59575,10 +61387,7 @@ export function bootstrap( const { status, body } = await implementation.actionsDeleteEnvironmentSecret(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = actionsDeleteEnvironmentSecretResponseValidator(status, body) ctx.status = status return next() } @@ -59594,6 +61403,27 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const actionsListEnvironmentVariablesResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + variables: z.array( + z.object({ + name: z.coerce.string(), + value: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + }), + ], + ], + undefined + ) + router.get( "actionsListEnvironmentVariables", "/repositories/:repositoryId/environments/:environmentName/variables", @@ -59613,25 +61443,7 @@ export function bootstrap( const { status, body } = await implementation.actionsListEnvironmentVariables(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - variables: z.array( - z.object({ - name: z.coerce.string(), - value: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = actionsListEnvironmentVariablesResponseValidator(status, body) ctx.status = status return next() } @@ -59647,6 +61459,9 @@ export function bootstrap( value: z.coerce.string(), }) + const actionsCreateEnvironmentVariableResponseValidator = + responseValidationFactory([["201", s_empty_object]], undefined) + router.post( "actionsCreateEnvironmentVariable", "/repositories/:repositoryId/environments/:environmentName/variables", @@ -59666,365 +61481,630 @@ export function bootstrap( const { status, body } = await implementation.actionsCreateEnvironmentVariable(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_empty_object]], - undefined - )(status, body) + ctx.body = actionsCreateEnvironmentVariableResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const actionsGetEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), + }) + + const actionsGetEnvironmentVariableResponseValidator = + responseValidationFactory([["200", s_actions_variable]], undefined) + + router.get( + "actionsGetEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsGetEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsGetEnvironmentVariable(input, ctx) + + ctx.body = actionsGetEnvironmentVariableResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const actionsUpdateEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), + }) + + const actionsUpdateEnvironmentVariableBodySchema = z.object({ + name: z.coerce.string().optional(), + value: z.coerce.string().optional(), + }) + + const actionsUpdateEnvironmentVariableResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + + router.patch( + "actionsUpdateEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsUpdateEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + actionsUpdateEnvironmentVariableBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.actionsUpdateEnvironmentVariable(input, ctx) + + ctx.body = actionsUpdateEnvironmentVariableResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const actionsDeleteEnvironmentVariableParamSchema = z.object({ + repository_id: z.coerce.number(), + environment_name: z.coerce.string(), + name: z.coerce.string(), + }) + + const actionsDeleteEnvironmentVariableResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + + router.delete( + "actionsDeleteEnvironmentVariable", + "/repositories/:repositoryId/environments/:environmentName/variables/:name", + async (ctx, next) => { + const input = { + params: parseRequestInput( + actionsDeleteEnvironmentVariableParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.actionsDeleteEnvironmentVariable(input, ctx) + + ctx.body = actionsDeleteEnvironmentVariableResponseValidator(status, body) ctx.status = status return next() } ) - const actionsGetEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), - }) - - router.get( - "actionsGetEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsGetEnvironmentVariableParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsGetEnvironmentVariable(input, ctx) - - ctx.body = responseValidationFactory( - [["200", s_actions_variable]], - undefined - )(status, body) - ctx.status = status - return next() + const searchCodeQuerySchema = z.object({ + q: z.coerce.string(), + sort: z.enum(["indexed"]).optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const searchCodeResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + name: z.coerce.string(), + path: z.coerce.string(), + sha: z.coerce.string(), + url: z.coerce.string(), + git_url: z.coerce.string(), + html_url: z.coerce.string(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + file_size: z.coerce.number().optional(), + language: z.coerce.string().optional(), + last_modified_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + line_numbers: z.array(z.coerce.string()).optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + + router.get("searchCode", "/search/code", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(searchCodeQuerySchema, ctx.query), + body: undefined, } - ) - - const actionsUpdateEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), - }) - - const actionsUpdateEnvironmentVariableBodySchema = z.object({ - name: z.coerce.string().optional(), - value: z.coerce.string().optional(), - }) - - router.patch( - "actionsUpdateEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsUpdateEnvironmentVariableParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - actionsUpdateEnvironmentVariableBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.actionsUpdateEnvironmentVariable(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) + const { status, body } = await implementation.searchCode(input, ctx) - const actionsDeleteEnvironmentVariableParamSchema = z.object({ - repository_id: z.coerce.number(), - environment_name: z.coerce.string(), - name: z.coerce.string(), + ctx.body = searchCodeResponseValidator(status, body) + ctx.status = status + return next() }) - router.delete( - "actionsDeleteEnvironmentVariable", - "/repositories/:repositoryId/environments/:environmentName/variables/:name", - async (ctx, next) => { - const input = { - params: parseRequestInput( - actionsDeleteEnvironmentVariableParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.actionsDeleteEnvironmentVariable(input, ctx) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const searchCodeQuerySchema = z.object({ + const searchCommitsQuerySchema = z.object({ q: z.coerce.string(), - sort: z.enum(["indexed"]).optional(), + sort: z.enum(["author-date", "committer-date"]).optional(), order: z.enum(["desc", "asc"]).optional(), per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get("searchCode", "/search/code", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(searchCodeQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.searchCode(input, ctx) - - ctx.body = responseValidationFactory( + const searchCommitsResponseValidator = responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - name: z.coerce.string(), - path: z.coerce.string(), - sha: z.coerce.string(), + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + url: z.coerce.string(), + sha: z.coerce.string(), + html_url: z.coerce.string(), + comments_url: z.coerce.string(), + commit: z.object({ + author: z.object({ + name: z.coerce.string(), + email: z.coerce.string(), + date: z.coerce.string().datetime({ offset: true }), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + comment_count: z.coerce.number(), + message: z.coerce.string(), + tree: z.object({ + sha: z.coerce.string(), + url: z.coerce.string(), + }), + url: z.coerce.string(), + verification: z + .object({ + verified: z.coerce.boolean(), + reason: z.coerce.string(), + payload: z.coerce.string(), + signature: z.coerce.string(), + }) + .optional(), + }), + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - git_url: z.coerce.string(), html_url: z.coerce.string(), - repository: z.object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + committer: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + date: z.coerce.string().optional(), + }), + parents: z.array( + z.object({ + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + }) + ), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - score: z.coerce.number(), - file_size: z.coerce.number().optional(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), language: z.coerce.string().optional(), - last_modified_at: z.coerce + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce .string() .datetime({ offset: true }) .optional(), - line_numbers: z.array(z.coerce.string()).optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) .optional(), - }) - ), - }), - ], - ["304", z.void()], - ["403", s_basic_error], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + score: z.coerce.number(), + node_id: z.coerce.string(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }), ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const searchCommitsQuerySchema = z.object({ - q: z.coerce.string(), - sort: z.enum(["author-date", "committer-date"]).optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ["304", z.void()], + ], + undefined + ) router.get("searchCommits", "/search/commits", async (ctx, next) => { const input = { @@ -60035,7 +62115,35 @@ export function bootstrap( const { status, body } = await implementation.searchCommits(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = searchCommitsResponseValidator(status, body) + ctx.status = status + return next() + }) + + const searchIssuesAndPullRequestsQuerySchema = z.object({ + q: z.coerce.string(), + sort: z + .enum([ + "comments", + "reactions", + "reactions-+1", + "reactions--1", + "reactions-smile", + "reactions-thinking_face", + "reactions-heart", + "reactions-tada", + "interactions", + "created", + "updated", + ]) + .optional(), + order: z.enum(["desc", "asc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const searchIssuesAndPullRequestsResponseValidator = + responseValidationFactory( [ [ "200", @@ -60045,37 +62153,45 @@ export function bootstrap( items: z.array( z.object({ url: z.coerce.string(), - sha: z.coerce.string(), - html_url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), comments_url: z.coerce.string(), - commit: z.object({ - author: z.object({ - name: z.coerce.string(), - email: z.coerce.string(), - date: z.coerce.string().datetime({ offset: true }), - }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - comment_count: z.coerce.number(), - message: z.coerce.string(), - tree: z.object({ - sha: z.coerce.string(), - url: z.coerce.string(), - }), - url: z.coerce.string(), - verification: z - .object({ - verified: z.coerce.boolean(), - reason: z.coerce.string(), - payload: z.coerce.string(), - signature: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + title: z.coerce.string(), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }) - .optional(), - }), - author: z.object({ + ) + .optional(), + user: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -60098,337 +62214,53 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - committer: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - date: z.coerce.string().optional(), - }), - parents: z.array( + labels: z.array( z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - sha: z.coerce.string().optional(), + name: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + description: z.coerce.string().optional(), }) ), - repository: z.object({ + state: z.coerce.string(), + state_reason: z.coerce.string().optional(), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), }), - score: z.coerce.number(), - node_id: z.coerce.string(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const searchIssuesAndPullRequestsQuerySchema = z.object({ - q: z.coerce.string(), - sort: z - .enum([ - "comments", - "reactions", - "reactions-+1", - "reactions--1", - "reactions-smile", - "reactions-thinking_face", - "reactions-heart", - "reactions-tada", - "interactions", - "created", - "updated", - ]) - .optional(), - order: z.enum(["desc", "asc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "searchIssuesAndPullRequests", - "/search/issues", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - searchIssuesAndPullRequestsQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = await implementation.searchIssuesAndPullRequests( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ + milestone: z.object({ url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), number: z.coerce.number(), - title: z.coerce.string(), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - description: z.coerce.string().optional(), - }) - ), - state: z.coerce.string(), - state_reason: z.coerce.string().optional(), - assignee: z.object({ + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -60451,143 +62283,76 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - comments: z.coerce.number(), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), closed_at: z.coerce.string().datetime({ offset: true }), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) + due_on: z.coerce.string().datetime({ offset: true }), + }), + comments: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), }) - .optional(), - body: z.coerce.string().optional(), - score: z.coerce.number(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - draft: z.coerce.boolean().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + ) + .optional(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + body: z.coerce.string().optional(), + score: z.coerce.number(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + draft: z.coerce.boolean().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -60609,324 +62374,376 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - performed_via_github_app: z - .object({ + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - ["403", s_basic_error], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "searchIssuesAndPullRequests", + "/search/issues", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + searchIssuesAndPullRequestsQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = await implementation.searchIssuesAndPullRequests( + input, + ctx + ) + + ctx.body = searchIssuesAndPullRequestsResponseValidator(status, body) ctx.status = status return next() } @@ -60941,6 +62758,53 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const searchLabelsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + name: z.coerce.string(), + color: z.coerce.string(), + default: z.coerce.boolean(), + description: z.coerce.string(), + score: z.coerce.number(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get("searchLabels", "/search/labels", async (ctx, next) => { const input = { params: undefined, @@ -60950,52 +62814,7 @@ export function bootstrap( const { status, body } = await implementation.searchLabels(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - name: z.coerce.string(), - color: z.coerce.string(), - default: z.coerce.boolean(), - description: z.coerce.string(), - score: z.coerce.number(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = searchLabelsResponseValidator(status, body) ctx.status = status return next() }) @@ -61010,6 +62829,176 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const searchReposResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + pushed_at: z.coerce.string().datetime({ offset: true }), + homepage: z.coerce.string(), + size: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + open_issues_count: z.coerce.number(), + master_branch: z.coerce.string().optional(), + default_branch: z.coerce.string(), + score: z.coerce.number(), + forks_url: z.coerce.string(), + keys_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + teams_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + events_url: z.coerce.string(), + assignees_url: z.coerce.string(), + branches_url: z.coerce.string(), + tags_url: z.coerce.string(), + blobs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + trees_url: z.coerce.string(), + statuses_url: z.coerce.string(), + languages_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + contributors_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + commits_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + comments_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + contents_url: z.coerce.string(), + compare_url: z.coerce.string(), + merges_url: z.coerce.string(), + archive_url: z.coerce.string(), + downloads_url: z.coerce.string(), + issues_url: z.coerce.string(), + pulls_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + labels_url: z.coerce.string(), + releases_url: z.coerce.string(), + deployments_url: z.coerce.string(), + git_url: z.coerce.string(), + ssh_url: z.coerce.string(), + clone_url: z.coerce.string(), + svn_url: z.coerce.string(), + forks: z.coerce.number(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + topics: z.array(z.coerce.string()).optional(), + mirror_url: z.coerce.string(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + permissions: z + .object({ + admin: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean(), + }) + .optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + }) + ), + }), + ], + ["304", z.void()], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get("searchRepos", "/search/repositories", async (ctx, next) => { const input = { params: undefined, @@ -61019,175 +63008,7 @@ export function bootstrap( const { status, body } = await implementation.searchRepos(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - pushed_at: z.coerce.string().datetime({ offset: true }), - homepage: z.coerce.string(), - size: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - open_issues_count: z.coerce.number(), - master_branch: z.coerce.string().optional(), - default_branch: z.coerce.string(), - score: z.coerce.number(), - forks_url: z.coerce.string(), - keys_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - teams_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - events_url: z.coerce.string(), - assignees_url: z.coerce.string(), - branches_url: z.coerce.string(), - tags_url: z.coerce.string(), - blobs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - trees_url: z.coerce.string(), - statuses_url: z.coerce.string(), - languages_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - contributors_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - commits_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - comments_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - contents_url: z.coerce.string(), - compare_url: z.coerce.string(), - merges_url: z.coerce.string(), - archive_url: z.coerce.string(), - downloads_url: z.coerce.string(), - issues_url: z.coerce.string(), - pulls_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - labels_url: z.coerce.string(), - releases_url: z.coerce.string(), - deployments_url: z.coerce.string(), - git_url: z.coerce.string(), - ssh_url: z.coerce.string(), - clone_url: z.coerce.string(), - svn_url: z.coerce.string(), - forks: z.coerce.number(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - topics: z.array(z.coerce.string()).optional(), - mirror_url: z.coerce.string(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - permissions: z - .object({ - admin: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean(), - }) - .optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - }) - ), - }), - ], - ["304", z.void()], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = searchReposResponseValidator(status, body) ctx.status = status return next() }) @@ -61198,6 +63019,83 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const searchTopicsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + short_description: z.coerce.string(), + description: z.coerce.string(), + created_by: z.coerce.string(), + released: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + featured: z.coerce.boolean(), + curated: z.coerce.boolean(), + score: z.coerce.number(), + repository_count: z.coerce.number().optional(), + logo_url: z.coerce.string().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + related: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + aliases: z + .array( + z.object({ + topic_relation: z + .object({ + id: z.coerce.number().optional(), + name: z.coerce.string().optional(), + topic_id: z.coerce.number().optional(), + relation_type: z.coerce.string().optional(), + }) + .optional(), + }) + ) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ], + undefined + ) + router.get("searchTopics", "/search/topics", async (ctx, next) => { const input = { params: undefined, @@ -61207,82 +63105,7 @@ export function bootstrap( const { status, body } = await implementation.searchTopics(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - short_description: z.coerce.string(), - description: z.coerce.string(), - created_by: z.coerce.string(), - released: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - featured: z.coerce.boolean(), - curated: z.coerce.boolean(), - score: z.coerce.number(), - repository_count: z.coerce.number().optional(), - logo_url: z.coerce.string().optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - related: z - .array( - z.object({ - topic_relation: z - .object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - topic_id: z.coerce.number().optional(), - relation_type: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .optional(), - aliases: z - .array( - z.object({ - topic_relation: z - .object({ - id: z.coerce.number().optional(), - name: z.coerce.string().optional(), - topic_id: z.coerce.number().optional(), - relation_type: z.coerce.string().optional(), - }) - .optional(), - }) - ) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - ], - undefined - )(status, body) + ctx.body = searchTopicsResponseValidator(status, body) ctx.status = status return next() }) @@ -61295,6 +63118,93 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const searchUsersResponseValidator = responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + incomplete_results: z.coerce.boolean(), + items: z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + score: z.coerce.number(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + events_url: z.coerce.string(), + public_repos: z.coerce.number().optional(), + public_gists: z.coerce.number().optional(), + followers: z.coerce.number().optional(), + following: z.coerce.number().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + name: z.coerce.string().optional(), + bio: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + location: z.coerce.string().optional(), + site_admin: z.coerce.boolean(), + hireable: z.coerce.boolean().optional(), + text_matches: z + .array( + z.object({ + object_url: z.coerce.string().optional(), + object_type: z.coerce.string().optional(), + property: z.coerce.string().optional(), + fragment: z.coerce.string().optional(), + matches: z + .array( + z.object({ + text: z.coerce.string().optional(), + indices: z.array(z.coerce.number()).optional(), + }) + ) + .optional(), + }) + ) + .optional(), + blog: z.coerce.string().optional(), + company: z.coerce.string().optional(), + suspended_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + }) + ), + }), + ], + ["304", z.void()], + ["422", s_validation_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.get("searchUsers", "/search/users", async (ctx, next) => { const input = { params: undefined, @@ -61304,98 +63214,21 @@ export function bootstrap( const { status, body } = await implementation.searchUsers(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - incomplete_results: z.coerce.boolean(), - items: z.array( - z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - score: z.coerce.number(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - events_url: z.coerce.string(), - public_repos: z.coerce.number().optional(), - public_gists: z.coerce.number().optional(), - followers: z.coerce.number().optional(), - following: z.coerce.number().optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - name: z.coerce.string().optional(), - bio: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - location: z.coerce.string().optional(), - site_admin: z.coerce.boolean(), - hireable: z.coerce.boolean().optional(), - text_matches: z - .array( - z.object({ - object_url: z.coerce.string().optional(), - object_type: z.coerce.string().optional(), - property: z.coerce.string().optional(), - fragment: z.coerce.string().optional(), - matches: z - .array( - z.object({ - text: z.coerce.string().optional(), - indices: z.array(z.coerce.number()).optional(), - }) - ) - .optional(), - }) - ) - .optional(), - blog: z.coerce.string().optional(), - company: z.coerce.string().optional(), - suspended_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - }) - ), - }), - ], - ["304", z.void()], - ["422", s_validation_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = searchUsersResponseValidator(status, body) ctx.status = status return next() }) const teamsGetLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + const teamsGetLegacyResponseValidator = responseValidationFactory( + [ + ["200", s_team_full], + ["404", s_basic_error], + ], + undefined + ) + router.get("teamsGetLegacy", "/teams/:teamId", async (ctx, next) => { const input = { params: parseRequestInput(teamsGetLegacyParamSchema, ctx.params), @@ -61405,13 +63238,7 @@ export function bootstrap( const { status, body } = await implementation.teamsGetLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_full], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = teamsGetLegacyResponseValidator(status, body) ctx.status = status return next() }) @@ -61426,6 +63253,17 @@ export function bootstrap( parent_team_id: z.coerce.number().optional(), }) + const teamsUpdateLegacyResponseValidator = responseValidationFactory( + [ + ["200", s_team_full], + ["201", s_team_full], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch("teamsUpdateLegacy", "/teams/:teamId", async (ctx, next) => { const input = { params: parseRequestInput(teamsUpdateLegacyParamSchema, ctx.params), @@ -61435,22 +63273,22 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_full], - ["201", s_team_full], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsUpdateLegacyResponseValidator(status, body) ctx.status = status return next() }) const teamsDeleteLegacyParamSchema = z.object({ team_id: z.coerce.number() }) + const teamsDeleteLegacyResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete("teamsDeleteLegacy", "/teams/:teamId", async (ctx, next) => { const input = { params: parseRequestInput(teamsDeleteLegacyParamSchema, ctx.params), @@ -61460,14 +63298,7 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsDeleteLegacyResponseValidator(status, body) ctx.status = status return next() }) @@ -61482,6 +63313,72 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListDiscussionsLegacyResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + comments_count: z.coerce.number(), + comments_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + pinned: z.coerce.boolean(), + private: z.coerce.boolean(), + team_url: z.coerce.string(), + title: z.coerce.string(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListDiscussionsLegacy", "/teams/:teamId/discussions", @@ -61502,72 +63399,8 @@ export function bootstrap( input, ctx ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - comments_count: z.coerce.number(), - comments_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - pinned: z.coerce.boolean(), - private: z.coerce.boolean(), - team_url: z.coerce.string(), - title: z.coerce.string(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + + ctx.body = teamsListDiscussionsLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -61583,6 +63416,9 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) + const teamsCreateDiscussionLegacyResponseValidator = + responseValidationFactory([["201", s_team_discussion]], undefined) + router.post( "teamsCreateDiscussionLegacy", "/teams/:teamId/discussions", @@ -61604,10 +63440,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["201", s_team_discussion]], - undefined - )(status, body) + ctx.body = teamsCreateDiscussionLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -61618,6 +63451,11 @@ export function bootstrap( discussion_number: z.coerce.number(), }) + const teamsGetDiscussionLegacyResponseValidator = responseValidationFactory( + [["200", s_team_discussion]], + undefined + ) + router.get( "teamsGetDiscussionLegacy", "/teams/:teamId/discussions/:discussionNumber", @@ -61636,10 +63474,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_team_discussion]], - undefined - )(status, body) + ctx.body = teamsGetDiscussionLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -61657,6 +63492,9 @@ export function bootstrap( }) .optional() + const teamsUpdateDiscussionLegacyResponseValidator = + responseValidationFactory([["200", s_team_discussion]], undefined) + router.patch( "teamsUpdateDiscussionLegacy", "/teams/:teamId/discussions/:discussionNumber", @@ -61678,10 +63516,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_team_discussion]], - undefined - )(status, body) + ctx.body = teamsUpdateDiscussionLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -61692,6 +63527,9 @@ export function bootstrap( discussion_number: z.coerce.number(), }) + const teamsDeleteDiscussionLegacyResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "teamsDeleteDiscussionLegacy", "/teams/:teamId/discussions/:discussionNumber", @@ -61710,10 +63548,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = teamsDeleteDiscussionLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -61730,6 +63565,68 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListDiscussionCommentsLegacyResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + author: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + body: z.coerce.string(), + body_html: z.coerce.string(), + body_version: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + last_edited_at: z.coerce.string().datetime({ offset: true }), + discussion_url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + number: z.coerce.number(), + updated_at: z.coerce.string().datetime({ offset: true }), + url: z.coerce.string(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListDiscussionCommentsLegacy", "/teams/:teamId/discussions/:discussionNumber/comments", @@ -61749,66 +63646,10 @@ export function bootstrap( const { status, body } = await implementation.teamsListDiscussionCommentsLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - author: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - body: z.coerce.string(), - body_html: z.coerce.string(), - body_version: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - last_edited_at: z.coerce.string().datetime({ offset: true }), - discussion_url: z.coerce.string(), - html_url: z.coerce.string(), - node_id: z.coerce.string(), - number: z.coerce.number(), - updated_at: z.coerce.string().datetime({ offset: true }), - url: z.coerce.string(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListDiscussionCommentsLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -61823,6 +63664,9 @@ export function bootstrap( body: z.coerce.string(), }) + const teamsCreateDiscussionCommentLegacyResponseValidator = + responseValidationFactory([["201", s_team_discussion_comment]], undefined) + router.post( "teamsCreateDiscussionCommentLegacy", "/teams/:teamId/discussions/:discussionNumber/comments", @@ -61842,10 +63686,10 @@ export function bootstrap( const { status, body } = await implementation.teamsCreateDiscussionCommentLegacy(input, ctx) - ctx.body = responseValidationFactory( - [["201", s_team_discussion_comment]], - undefined - )(status, body) + ctx.body = teamsCreateDiscussionCommentLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -61857,6 +63701,9 @@ export function bootstrap( comment_number: z.coerce.number(), }) + const teamsGetDiscussionCommentLegacyResponseValidator = + responseValidationFactory([["200", s_team_discussion_comment]], undefined) + router.get( "teamsGetDiscussionCommentLegacy", "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", @@ -61873,10 +63720,7 @@ export function bootstrap( const { status, body } = await implementation.teamsGetDiscussionCommentLegacy(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_team_discussion_comment]], - undefined - )(status, body) + ctx.body = teamsGetDiscussionCommentLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -61892,6 +63736,9 @@ export function bootstrap( body: z.coerce.string(), }) + const teamsUpdateDiscussionCommentLegacyResponseValidator = + responseValidationFactory([["200", s_team_discussion_comment]], undefined) + router.patch( "teamsUpdateDiscussionCommentLegacy", "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", @@ -61911,10 +63758,10 @@ export function bootstrap( const { status, body } = await implementation.teamsUpdateDiscussionCommentLegacy(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_team_discussion_comment]], - undefined - )(status, body) + ctx.body = teamsUpdateDiscussionCommentLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -61926,6 +63773,9 @@ export function bootstrap( comment_number: z.coerce.number(), }) + const teamsDeleteDiscussionCommentLegacyResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "teamsDeleteDiscussionCommentLegacy", "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber", @@ -61942,7 +63792,7 @@ export function bootstrap( const { status, body } = await implementation.teamsDeleteDiscussionCommentLegacy(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( + ctx.body = teamsDeleteDiscussionCommentLegacyResponseValidator( status, body ) @@ -61974,6 +63824,56 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForTeamDiscussionCommentLegacyResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + router.get( "reactionsListForTeamDiscussionCommentLegacy", "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", @@ -61996,54 +63896,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reactionsListForTeamDiscussionCommentLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62068,6 +63924,9 @@ export function bootstrap( ]), }) + const reactionsCreateForTeamDiscussionCommentLegacyResponseValidator = + responseValidationFactory([["201", s_reaction]], undefined) + router.post( "reactionsCreateForTeamDiscussionCommentLegacy", "/teams/:teamId/discussions/:discussionNumber/comments/:commentNumber/reactions", @@ -62090,7 +63949,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["201", s_reaction]], undefined)( + ctx.body = reactionsCreateForTeamDiscussionCommentLegacyResponseValidator( status, body ) @@ -62121,6 +63980,56 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const reactionsListForTeamDiscussionLegacyResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + content: z.enum([ + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "rocket", + "eyes", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + router.get( "reactionsListForTeamDiscussionLegacy", "/teams/:teamId/discussions/:discussionNumber/reactions", @@ -62140,54 +64049,10 @@ export function bootstrap( const { status, body } = await implementation.reactionsListForTeamDiscussionLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - content: z.enum([ - "+1", - "-1", - "laugh", - "confused", - "heart", - "hooray", - "rocket", - "eyes", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = reactionsListForTeamDiscussionLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62211,6 +64076,9 @@ export function bootstrap( ]), }) + const reactionsCreateForTeamDiscussionLegacyResponseValidator = + responseValidationFactory([["201", s_reaction]], undefined) + router.post( "reactionsCreateForTeamDiscussionLegacy", "/teams/:teamId/discussions/:discussionNumber/reactions", @@ -62230,7 +64098,7 @@ export function bootstrap( const { status, body } = await implementation.reactionsCreateForTeamDiscussionLegacy(input, ctx) - ctx.body = responseValidationFactory([["201", s_reaction]], undefined)( + ctx.body = reactionsCreateForTeamDiscussionLegacyResponseValidator( status, body ) @@ -62248,6 +64116,54 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListPendingInvitationsLegacyResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + email: z.coerce.string(), + role: z.coerce.string(), + created_at: z.coerce.string(), + failed_at: z.coerce.string().optional(), + failed_reason: z.coerce.string().optional(), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + team_count: z.coerce.number(), + node_id: z.coerce.string(), + invitation_teams_url: z.coerce.string(), + invitation_source: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "teamsListPendingInvitationsLegacy", "/teams/:teamId/invitations", @@ -62267,52 +64183,10 @@ export function bootstrap( const { status, body } = await implementation.teamsListPendingInvitationsLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - email: z.coerce.string(), - role: z.coerce.string(), - created_at: z.coerce.string(), - failed_at: z.coerce.string().optional(), - failed_reason: z.coerce.string().optional(), - inviter: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - team_count: z.coerce.number(), - node_id: z.coerce.string(), - invitation_teams_url: z.coerce.string(), - invitation_source: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = teamsListPendingInvitationsLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62328,6 +64202,41 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListMembersLegacyResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "teamsListMembersLegacy", "/teams/:teamId/members", @@ -62346,40 +64255,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = teamsListMembersLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62390,6 +64266,14 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsGetMemberLegacyResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "teamsGetMemberLegacy", "/teams/:teamId/members/:username", @@ -62405,13 +64289,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsGetMemberLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62422,6 +64300,16 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsAddMemberLegacyResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["404", z.void()], + ["422", z.void()], + ], + undefined + ) + router.put( "teamsAddMemberLegacy", "/teams/:teamId/members/:username", @@ -62437,15 +64325,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["404", z.void()], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsAddMemberLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62456,6 +64336,14 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsRemoveMemberLegacyResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.delete( "teamsRemoveMemberLegacy", "/teams/:teamId/members/:username", @@ -62474,13 +64362,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsRemoveMemberLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62491,6 +64373,15 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsGetMembershipForUserLegacyResponseValidator = + responseValidationFactory( + [ + ["200", s_team_membership], + ["404", s_basic_error], + ], + undefined + ) + router.get( "teamsGetMembershipForUserLegacy", "/teams/:teamId/memberships/:username", @@ -62507,13 +64398,7 @@ export function bootstrap( const { status, body } = await implementation.teamsGetMembershipForUserLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_membership], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = teamsGetMembershipForUserLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62528,6 +64413,17 @@ export function bootstrap( .object({ role: z.enum(["member", "maintainer"]).optional() }) .optional() + const teamsAddOrUpdateMembershipForUserLegacyResponseValidator = + responseValidationFactory( + [ + ["200", s_team_membership], + ["403", z.void()], + ["404", s_basic_error], + ["422", z.void()], + ], + undefined + ) + router.put( "teamsAddOrUpdateMembershipForUserLegacy", "/teams/:teamId/memberships/:username", @@ -62547,15 +64443,10 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateMembershipForUserLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_membership], - ["403", z.void()], - ["404", s_basic_error], - ["422", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsAddOrUpdateMembershipForUserLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62566,6 +64457,15 @@ export function bootstrap( username: z.coerce.string(), }) + const teamsRemoveMembershipForUserLegacyResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", z.void()], + ], + undefined + ) + router.delete( "teamsRemoveMembershipForUserLegacy", "/teams/:teamId/memberships/:username", @@ -62582,13 +64482,10 @@ export function bootstrap( const { status, body } = await implementation.teamsRemoveMembershipForUserLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsRemoveMembershipForUserLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62603,6 +64500,62 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListProjectsLegacyResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string(), + updated_at: z.coerce.string(), + organization_permission: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + permissions: z.object({ + read: z.coerce.boolean(), + write: z.coerce.boolean(), + admin: z.coerce.boolean(), + }), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "teamsListProjectsLegacy", "/teams/:teamId/projects", @@ -62621,61 +64574,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string(), - updated_at: z.coerce.string(), - organization_permission: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - permissions: z.object({ - read: z.coerce.boolean(), - write: z.coerce.boolean(), - admin: z.coerce.boolean(), - }), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = teamsListProjectsLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62686,6 +64585,15 @@ export function bootstrap( project_id: z.coerce.number(), }) + const teamsCheckPermissionsForProjectLegacyResponseValidator = + responseValidationFactory( + [ + ["200", s_team_project], + ["404", z.void()], + ], + undefined + ) + router.get( "teamsCheckPermissionsForProjectLegacy", "/teams/:teamId/projects/:projectId", @@ -62702,13 +64610,10 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForProjectLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_project], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsCheckPermissionsForProjectLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62723,6 +64628,23 @@ export function bootstrap( .object({ permission: z.enum(["read", "write", "admin"]).optional() }) .optional() + const teamsAddOrUpdateProjectPermissionsLegacyResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + [ + "403", + z.object({ + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "teamsAddOrUpdateProjectPermissionsLegacy", "/teams/:teamId/projects/:projectId", @@ -62745,21 +64667,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - [ - "403", - z.object({ - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsAddOrUpdateProjectPermissionsLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -62770,6 +64681,15 @@ export function bootstrap( project_id: z.coerce.number(), }) + const teamsRemoveProjectLegacyResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "teamsRemoveProjectLegacy", "/teams/:teamId/projects/:projectId", @@ -62788,14 +64708,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsRemoveProjectLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -62810,6 +64723,171 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListReposLegacyResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ["404", s_basic_error], + ], + undefined + ) + router.get( "teamsListReposLegacy", "/teams/:teamId/repos", @@ -62825,179 +64903,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = teamsListReposLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -63009,6 +64915,16 @@ export function bootstrap( repo: z.coerce.string(), }) + const teamsCheckPermissionsForRepoLegacyResponseValidator = + responseValidationFactory( + [ + ["200", s_team_repository], + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "teamsCheckPermissionsForRepoLegacy", "/teams/:teamId/repos/:owner/:repo", @@ -63025,14 +64941,10 @@ export function bootstrap( const { status, body } = await implementation.teamsCheckPermissionsForRepoLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_team_repository], - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = teamsCheckPermissionsForRepoLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63048,6 +64960,16 @@ export function bootstrap( .object({ permission: z.enum(["pull", "push", "admin"]).optional() }) .optional() + const teamsAddOrUpdateRepoPermissionsLegacyResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "teamsAddOrUpdateRepoPermissionsLegacy", "/teams/:teamId/repos/:owner/:repo", @@ -63067,14 +64989,10 @@ export function bootstrap( const { status, body } = await implementation.teamsAddOrUpdateRepoPermissionsLegacy(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsAddOrUpdateRepoPermissionsLegacyResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63086,6 +65004,11 @@ export function bootstrap( repo: z.coerce.string(), }) + const teamsRemoveRepoLegacyResponseValidator = responseValidationFactory( + [["204", z.void()]], + undefined + ) + router.delete( "teamsRemoveRepoLegacy", "/teams/:teamId/repos/:owner/:repo", @@ -63101,10 +65024,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = teamsRemoveRepoLegacyResponseValidator(status, body) ctx.status = status return next() } @@ -63119,6 +65039,56 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const teamsListChildLegacyResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.coerce.string().optional(), + permission: z.coerce.string(), + permissions: z + .object({ + pull: z.coerce.boolean(), + triage: z.coerce.boolean(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean(), + admin: z.coerce.boolean(), + }) + .optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), + html_url: z.coerce.string(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }), + }) + ), + ], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "teamsListChildLegacy", "/teams/:teamId/teams", @@ -63134,60 +65104,22 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.coerce.string().optional(), - permission: z.coerce.string(), - permissions: z - .object({ - pull: z.coerce.boolean(), - triage: z.coerce.boolean(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean(), - admin: z.coerce.boolean(), - }) - .optional(), - url: z.coerce.string(), - html_url: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), - html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), - }), - }) - ), - ], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = teamsListChildLegacyResponseValidator(status, body) ctx.status = status return next() } ) + const usersGetAuthenticatedResponseValidator = responseValidationFactory( + [ + ["200", z.union([s_private_user, s_public_user])], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get("usersGetAuthenticated", "/user", async (ctx, next) => { const input = { params: undefined, @@ -63200,15 +65132,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.union([s_private_user, s_public_user])], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersGetAuthenticatedResponseValidator(status, body) ctx.status = status return next() }) @@ -63226,6 +65150,18 @@ export function bootstrap( }) .optional() + const usersUpdateAuthenticatedResponseValidator = responseValidationFactory( + [ + ["200", s_private_user], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch("usersUpdateAuthenticated", "/user", async (ctx, next) => { const input = { params: undefined, @@ -63238,17 +65174,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_private_user], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersUpdateAuthenticatedResponseValidator(status, body) ctx.status = status return next() }) @@ -63258,6 +65184,45 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListBlockedByAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersListBlockedByAuthenticatedUser", "/user/blocks", @@ -63274,43 +65239,10 @@ export function bootstrap( const { status, body } = await implementation.usersListBlockedByAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListBlockedByAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63318,6 +65250,17 @@ export function bootstrap( const usersCheckBlockedParamSchema = z.object({ username: z.coerce.string() }) + const usersCheckBlockedResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersCheckBlocked", "/user/blocks/:username", @@ -63333,16 +65276,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersCheckBlockedResponseValidator(status, body) ctx.status = status return next() } @@ -63350,6 +65284,18 @@ export function bootstrap( const usersBlockParamSchema = z.object({ username: z.coerce.string() }) + const usersBlockResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put("usersBlock", "/user/blocks/:username", async (ctx, next) => { const input = { params: parseRequestInput(usersBlockParamSchema, ctx.params), @@ -63359,23 +65305,24 @@ export function bootstrap( const { status, body } = await implementation.usersBlock(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersBlockResponseValidator(status, body) ctx.status = status return next() }) const usersUnblockParamSchema = z.object({ username: z.coerce.string() }) + const usersUnblockResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete("usersUnblock", "/user/blocks/:username", async (ctx, next) => { const input = { params: parseRequestInput(usersUnblockParamSchema, ctx.params), @@ -63385,16 +65332,7 @@ export function bootstrap( const { status, body } = await implementation.usersUnblock(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersUnblockResponseValidator(status, body) ctx.status = status return next() }) @@ -63405,34 +65343,70 @@ export function bootstrap( repository_id: z.coerce.number().optional(), }) - router.get( - "codespacesListForAuthenticatedUser", - "/user/codespaces", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - codespacesListForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.codespacesListForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( + const codespacesListForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - codespaces: z.array( - z.object({ + "200", + z.object({ + total_count: z.coerce.number(), + codespaces: z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + display_name: z.coerce.string().optional(), + environment_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + billable_owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + repository: z.object({ id: z.coerce.number(), + node_id: z.coerce.string(), name: z.coerce.string(), - display_name: z.coerce.string().optional(), - environment_id: z.coerce.string(), + full_name: z.coerce.string(), owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), @@ -63456,280 +65430,248 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - billable_owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - repository: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }), - machine: z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }), - devcontainer_path: z.coerce.string().optional(), - prebuild: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - last_used_at: z.coerce.string().datetime({ offset: true }), - state: z.enum([ - "Unknown", - "Created", - "Queued", - "Provisioning", - "Available", - "Awaiting", - "Unavailable", - "Deleted", - "Moved", - "Shutdown", - "Archived", - "Starting", - "ShuttingDown", - "Failed", - "Exporting", - "Updating", - "Rebuilding", - ]), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - git_status: z.object({ - ahead: z.coerce.number().optional(), - behind: z.coerce.number().optional(), - has_unpushed_changes: z.coerce.boolean().optional(), - has_uncommitted_changes: z.coerce.boolean().optional(), - ref: z.coerce.string().optional(), - }), - location: z.enum([ - "EastUs", - "SouthEastAsia", - "WestEurope", - "WestUs2", - ]), - idle_timeout_minutes: z.coerce.number(), - web_url: z.coerce.string(), - machines_url: z.coerce.string(), - start_url: z.coerce.string(), - stop_url: z.coerce.string(), - publish_url: z.coerce.string().optional(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), pulls_url: z.coerce.string(), - recent_folders: z.array(z.coerce.string()), - runtime_constraints: z - .object({ - allowed_port_privacy_settings: z - .array(z.coerce.string()) - .optional(), - }) + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) .optional(), - pending_operation: z.coerce.boolean().optional(), - pending_operation_disabled_reason: z.coerce + created_at: z.coerce .string() + .datetime({ offset: true }) .optional(), - idle_timeout_notice: z.coerce.string().optional(), - retention_period_minutes: z.coerce.number().optional(), - retention_expires_at: z.coerce + updated_at: z.coerce .string() .datetime({ offset: true }) .optional(), - last_known_stop_notice: z.coerce.string().optional(), - }) - ), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + machine: z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum([ + "none", + "ready", + "in_progress", + ]), + }), + devcontainer_path: z.coerce.string().optional(), + prebuild: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + last_used_at: z.coerce.string().datetime({ offset: true }), + state: z.enum([ + "Unknown", + "Created", + "Queued", + "Provisioning", + "Available", + "Awaiting", + "Unavailable", + "Deleted", + "Moved", + "Shutdown", + "Archived", + "Starting", + "ShuttingDown", + "Failed", + "Exporting", + "Updating", + "Rebuilding", + ]), + url: z.coerce.string(), + git_status: z.object({ + ahead: z.coerce.number().optional(), + behind: z.coerce.number().optional(), + has_unpushed_changes: z.coerce.boolean().optional(), + has_uncommitted_changes: z.coerce.boolean().optional(), + ref: z.coerce.string().optional(), + }), + location: z.enum([ + "EastUs", + "SouthEastAsia", + "WestEurope", + "WestUs2", + ]), + idle_timeout_minutes: z.coerce.number(), + web_url: z.coerce.string(), + machines_url: z.coerce.string(), + start_url: z.coerce.string(), + stop_url: z.coerce.string(), + publish_url: z.coerce.string().optional(), + pulls_url: z.coerce.string(), + recent_folders: z.array(z.coerce.string()), + runtime_constraints: z + .object({ + allowed_port_privacy_settings: z + .array(z.coerce.string()) + .optional(), + }) + .optional(), + pending_operation: z.coerce.boolean().optional(), + pending_operation_disabled_reason: z.coerce.string().optional(), + idle_timeout_notice: z.coerce.string().optional(), + retention_period_minutes: z.coerce.number().optional(), + retention_expires_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + last_known_stop_notice: z.coerce.string().optional(), + }) + ), + }), ], - undefined - )(status, body) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + + router.get( + "codespacesListForAuthenticatedUser", + "/user/codespaces", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + codespacesListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.codespacesListForAuthenticatedUser(input, ctx) + + ctx.body = codespacesListForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63762,6 +65704,26 @@ export function bootstrap( }), ]) + const codespacesCreateForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_codespace], + ["202", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + [ + "503", + z.object({ + code: z.coerce.string().optional(), + message: z.coerce.string().optional(), + documentation_url: z.coerce.string().optional(), + }), + ], + ], + undefined + ) + router.post( "codespacesCreateForAuthenticatedUser", "/user/codespaces", @@ -63778,24 +65740,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesCreateForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_codespace], - ["202", s_codespace], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - [ - "503", - z.object({ - code: z.coerce.string().optional(), - message: z.coerce.string().optional(), - documentation_url: z.coerce.string().optional(), - }), - ], - ], - undefined - )(status, body) + ctx.body = codespacesCreateForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63806,6 +65754,28 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const codespacesListSecretsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + secrets: z.array( + z.object({ + name: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + visibility: z.enum(["all", "private", "selected"]), + selected_repositories_url: z.coerce.string(), + }) + ), + }), + ], + ], + undefined + ) + router.get( "codespacesListSecretsForAuthenticatedUser", "/user/codespaces/secrets", @@ -63825,31 +65795,21 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - secrets: z.array( - z.object({ - name: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - visibility: z.enum(["all", "private", "selected"]), - selected_repositories_url: z.coerce.string(), - }) - ), - }), - ], - ], - undefined - )(status, body) + ctx.body = codespacesListSecretsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) + const codespacesGetPublicKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [["200", s_codespaces_user_public_key]], + undefined + ) + router.get( "codespacesGetPublicKeyForAuthenticatedUser", "/user/codespaces/secrets/public-key", @@ -63866,10 +65826,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_codespaces_user_public_key]], - undefined - )(status, body) + ctx.body = codespacesGetPublicKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63879,6 +65839,9 @@ export function bootstrap( secret_name: z.coerce.string(), }) + const codespacesGetSecretForAuthenticatedUserResponseValidator = + responseValidationFactory([["200", s_codespaces_secret]], undefined) + router.get( "codespacesGetSecretForAuthenticatedUser", "/user/codespaces/secrets/:secretName", @@ -63895,10 +65858,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesGetSecretForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_codespaces_secret]], - undefined - )(status, body) + ctx.body = codespacesGetSecretForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -63915,6 +65878,17 @@ export function bootstrap( } ) + const codespacesCreateOrUpdateSecretForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_empty_object], + ["204", z.void()], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.put( "codespacesCreateOrUpdateSecretForAuthenticatedUser", "/user/codespaces/secrets/:secretName", @@ -63937,54 +65911,234 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( + ctx.body = + codespacesCreateOrUpdateSecretForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const codespacesDeleteSecretForAuthenticatedUserParamSchema = z.object({ + secret_name: z.coerce.string(), + }) + + const codespacesDeleteSecretForAuthenticatedUserResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + + router.delete( + "codespacesDeleteSecretForAuthenticatedUser", + "/user/codespaces/secrets/:secretName", + async (ctx, next) => { + const input = { + params: parseRequestInput( + codespacesDeleteSecretForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.codespacesDeleteSecretForAuthenticatedUser( + input, + ctx + ) + + ctx.body = codespacesDeleteSecretForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema = + z.object({ secret_name: z.coerce.string() }) + + const codespacesListRepositoriesForSecretForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - ["201", s_empty_object], - ["204", z.void()], - ["404", s_basic_error], - ["422", s_validation_error], + "200", + z.object({ + total_count: z.coerce.number(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + }), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const codespacesDeleteSecretForAuthenticatedUserParamSchema = z.object({ - secret_name: z.coerce.string(), - }) - - router.delete( - "codespacesDeleteSecretForAuthenticatedUser", - "/user/codespaces/secrets/:secretName", - async (ctx, next) => { - const input = { - params: parseRequestInput( - codespacesDeleteSecretForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.codespacesDeleteSecretForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) - ctx.status = status - return next() - } - ) - - const codespacesListRepositoriesForSecretForAuthenticatedUserParamSchema = - z.object({ secret_name: z.coerce.string() }) + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) router.get( "codespacesListRepositoriesForSecretForAuthenticatedUser", @@ -64005,185 +66159,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - }), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesListRepositoriesForSecretForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64195,6 +66175,18 @@ export function bootstrap( const codespacesSetRepositoriesForSecretForAuthenticatedUserBodySchema = z.object({ selected_repository_ids: z.array(z.coerce.number()) }) + const codespacesSetRepositoriesForSecretForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.put( "codespacesSetRepositoriesForSecretForAuthenticatedUser", "/user/codespaces/secrets/:secretName/repositories", @@ -64217,16 +66209,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesSetRepositoriesForSecretForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64238,6 +66225,18 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const codespacesAddRepositoryForSecretForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.put( "codespacesAddRepositoryForSecretForAuthenticatedUser", "/user/codespaces/secrets/:secretName/repositories/:repositoryId", @@ -64257,16 +66256,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesAddRepositoryForSecretForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64278,6 +66272,18 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const codespacesRemoveRepositoryForSecretForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.delete( "codespacesRemoveRepositoryForSecretForAuthenticatedUser", "/user/codespaces/secrets/:secretName/repositories/:repositoryId", @@ -64297,16 +66303,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesRemoveRepositoryForSecretForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64316,6 +66317,19 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesGetForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_codespace], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.get( "codespacesGetForAuthenticatedUser", "/user/codespaces/:codespaceName", @@ -64332,17 +66346,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesGetForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_codespace], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesGetForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64360,6 +66367,17 @@ export function bootstrap( }) .optional() + const codespacesUpdateForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.patch( "codespacesUpdateForAuthenticatedUser", "/user/codespaces/:codespaceName", @@ -64379,15 +66397,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesUpdateForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_codespace], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesUpdateForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64397,6 +66410,19 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesDeleteForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["202", z.object({})], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.delete( "codespacesDeleteForAuthenticatedUser", "/user/codespaces/:codespaceName", @@ -64413,17 +66439,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesDeleteForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", z.object({})], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesDeleteForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64433,6 +66452,19 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesExportForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["202", s_codespace_export_details], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ["500", s_basic_error], + ], + undefined + ) + router.post( "codespacesExportForAuthenticatedUser", "/user/codespaces/:codespaceName/exports", @@ -64449,17 +66481,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesExportForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["202", s_codespace_export_details], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesExportForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64470,6 +66495,15 @@ export function bootstrap( export_id: z.coerce.string(), }) + const codespacesGetExportDetailsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_codespace_export_details], + ["404", s_basic_error], + ], + undefined + ) + router.get( "codespacesGetExportDetailsForAuthenticatedUser", "/user/codespaces/:codespaceName/exports/:exportId", @@ -64489,13 +66523,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_codespace_export_details], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesGetExportDetailsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64505,6 +66537,35 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesCodespaceMachinesForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + machines: z.array( + z.object({ + name: z.coerce.string(), + display_name: z.coerce.string(), + operating_system: z.coerce.string(), + storage_in_bytes: z.coerce.number(), + memory_in_bytes: z.coerce.number(), + cpus: z.coerce.number(), + prebuild_availability: z.enum(["none", "ready", "in_progress"]), + }) + ), + }), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.get( "codespacesCodespaceMachinesForAuthenticatedUser", "/user/codespaces/:codespaceName/machines", @@ -64524,37 +66585,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - machines: z.array( - z.object({ - name: z.coerce.string(), - display_name: z.coerce.string(), - operating_system: z.coerce.string(), - storage_in_bytes: z.coerce.number(), - memory_in_bytes: z.coerce.number(), - cpus: z.coerce.number(), - prebuild_availability: z.enum([ - "none", - "ready", - "in_progress", - ]), - }) - ), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + codespacesCodespaceMachinesForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64569,6 +66604,18 @@ export function bootstrap( private: z.coerce.boolean().optional(), }) + const codespacesPublishForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_codespace_with_full_repository], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "codespacesPublishForAuthenticatedUser", "/user/codespaces/:codespaceName/publish", @@ -64588,16 +66635,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesPublishForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_codespace_with_full_repository], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = codespacesPublishForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64607,6 +66648,22 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesStartForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_codespace], + ["304", z.void()], + ["400", s_scim_error], + ["401", s_basic_error], + ["402", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.post( "codespacesStartForAuthenticatedUser", "/user/codespaces/:codespaceName/start", @@ -64623,20 +66680,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesStartForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_codespace], - ["304", z.void()], - ["400", s_scim_error], - ["401", s_basic_error], - ["402", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["409", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesStartForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64646,6 +66693,18 @@ export function bootstrap( codespace_name: z.coerce.string(), }) + const codespacesStopForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_codespace], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["500", s_basic_error], + ], + undefined + ) + router.post( "codespacesStopForAuthenticatedUser", "/user/codespaces/:codespaceName/stop", @@ -64662,16 +66721,10 @@ export function bootstrap( const { status, body } = await implementation.codespacesStopForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_codespace], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["500", s_basic_error], - ], - undefined - )(status, body) + ctx.body = codespacesStopForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64681,6 +66734,29 @@ export function bootstrap( { visibility: z.enum(["public", "private"]) } ) + const usersSetPrimaryEmailVisibilityForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.patch( "usersSetPrimaryEmailVisibilityForAuthenticatedUser", "/user/email/visibility", @@ -64700,27 +66776,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = + usersSetPrimaryEmailVisibilityForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64731,6 +66791,28 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListEmailsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersListEmailsForAuthenticatedUser", "/user/emails", @@ -64747,26 +66829,10 @@ export function bootstrap( const { status, body } = await implementation.usersListEmailsForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListEmailsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64778,6 +66844,29 @@ export function bootstrap( z.coerce.string(), ]) + const usersAddEmailForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "201", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "usersAddEmailForAuthenticatedUser", "/user/emails", @@ -64794,27 +66883,10 @@ export function bootstrap( const { status, body } = await implementation.usersAddEmailForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "201", - z.array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersAddEmailForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64826,6 +66898,19 @@ export function bootstrap( z.coerce.string(), ]) + const usersDeleteEmailForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "usersDeleteEmailForAuthenticatedUser", "/user/emails", @@ -64842,17 +66927,10 @@ export function bootstrap( const { status, body } = await implementation.usersDeleteEmailForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersDeleteEmailForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64863,6 +66941,44 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListFollowersForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "usersListFollowersForAuthenticatedUser", "/user/followers", @@ -64879,42 +66995,10 @@ export function bootstrap( const { status, body } = await implementation.usersListFollowersForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListFollowersForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64925,6 +67009,44 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListFollowedByAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "usersListFollowedByAuthenticatedUser", "/user/following", @@ -64941,42 +67063,10 @@ export function bootstrap( const { status, body } = await implementation.usersListFollowedByAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListFollowedByAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -64986,6 +67076,18 @@ export function bootstrap( username: z.coerce.string(), }) + const usersCheckPersonIsFollowedByAuthenticatedResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersCheckPersonIsFollowedByAuthenticated", "/user/following/:username", @@ -65005,16 +67107,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersCheckPersonIsFollowedByAuthenticatedResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65022,6 +67118,17 @@ export function bootstrap( const usersFollowParamSchema = z.object({ username: z.coerce.string() }) + const usersFollowResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.put("usersFollow", "/user/following/:username", async (ctx, next) => { const input = { params: parseRequestInput(usersFollowParamSchema, ctx.params), @@ -65031,22 +67138,24 @@ export function bootstrap( const { status, body } = await implementation.usersFollow(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersFollowResponseValidator(status, body) ctx.status = status return next() }) const usersUnfollowParamSchema = z.object({ username: z.coerce.string() }) + const usersUnfollowResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "usersUnfollow", "/user/following/:username", @@ -65059,16 +67168,7 @@ export function bootstrap( const { status, body } = await implementation.usersUnfollow(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersUnfollowResponseValidator(status, body) ctx.status = status return next() } @@ -65079,6 +67179,61 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListGpgKeysForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersListGpgKeysForAuthenticatedUser", "/user/gpg_keys", @@ -65095,59 +67250,10 @@ export function bootstrap( const { status, body } = await implementation.usersListGpgKeysForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListGpgKeysForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65158,6 +67264,19 @@ export function bootstrap( armored_public_key: z.coerce.string(), }) + const usersCreateGpgKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_gpg_key], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "usersCreateGpgKeyForAuthenticatedUser", "/user/gpg_keys", @@ -65174,17 +67293,10 @@ export function bootstrap( const { status, body } = await implementation.usersCreateGpgKeyForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_gpg_key], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersCreateGpgKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65194,6 +67306,18 @@ export function bootstrap( gpg_key_id: z.coerce.number(), }) + const usersGetGpgKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_gpg_key], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersGetGpgKeyForAuthenticatedUser", "/user/gpg_keys/:gpgKeyId", @@ -65210,16 +67334,10 @@ export function bootstrap( const { status, body } = await implementation.usersGetGpgKeyForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_gpg_key], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersGetGpgKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65229,6 +67347,19 @@ export function bootstrap( gpg_key_id: z.coerce.number(), }) + const usersDeleteGpgKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.delete( "usersDeleteGpgKeyForAuthenticatedUser", "/user/gpg_keys/:gpgKeyId", @@ -65245,17 +67376,10 @@ export function bootstrap( const { status, body } = await implementation.usersDeleteGpgKeyForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersDeleteGpgKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65266,6 +67390,118 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const appsListInstallationsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.object({ + total_count: z.coerce.number(), + installations: z.array( + z.object({ + id: z.coerce.number(), + account: z.object({}), + repository_selection: z.enum(["all", "selected"]), + access_tokens_url: z.coerce.string(), + repositories_url: z.coerce.string(), + html_url: z.coerce.string(), + app_id: z.coerce.number(), + target_id: z.coerce.number(), + target_type: z.coerce.string(), + permissions: z.object({ + actions: z.enum(["read", "write"]).optional(), + administration: z.enum(["read", "write"]).optional(), + checks: z.enum(["read", "write"]).optional(), + contents: z.enum(["read", "write"]).optional(), + deployments: z.enum(["read", "write"]).optional(), + environments: z.enum(["read", "write"]).optional(), + issues: z.enum(["read", "write"]).optional(), + metadata: z.enum(["read", "write"]).optional(), + packages: z.enum(["read", "write"]).optional(), + pages: z.enum(["read", "write"]).optional(), + pull_requests: z.enum(["read", "write"]).optional(), + repository_announcement_banners: z + .enum(["read", "write"]) + .optional(), + repository_hooks: z.enum(["read", "write"]).optional(), + repository_projects: z + .enum(["read", "write", "admin"]) + .optional(), + secret_scanning_alerts: z.enum(["read", "write"]).optional(), + secrets: z.enum(["read", "write"]).optional(), + security_events: z.enum(["read", "write"]).optional(), + single_file: z.enum(["read", "write"]).optional(), + statuses: z.enum(["read", "write"]).optional(), + vulnerability_alerts: z.enum(["read", "write"]).optional(), + workflows: z.enum(["write"]).optional(), + members: z.enum(["read", "write"]).optional(), + organization_administration: z + .enum(["read", "write"]) + .optional(), + organization_custom_roles: z + .enum(["read", "write"]) + .optional(), + organization_announcement_banners: z + .enum(["read", "write"]) + .optional(), + organization_hooks: z.enum(["read", "write"]).optional(), + organization_plan: z.enum(["read"]).optional(), + organization_projects: z + .enum(["read", "write", "admin"]) + .optional(), + organization_packages: z.enum(["read", "write"]).optional(), + organization_secrets: z.enum(["read", "write"]).optional(), + organization_self_hosted_runners: z + .enum(["read", "write"]) + .optional(), + organization_user_blocking: z + .enum(["read", "write"]) + .optional(), + team_discussions: z.enum(["read", "write"]).optional(), + }), + events: z.array(z.coerce.string()), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + single_file_name: z.coerce.string(), + has_multiple_single_files: z.coerce.boolean().optional(), + single_file_paths: z.array(z.coerce.string()).optional(), + app_slug: z.coerce.string(), + suspended_by: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + suspended_at: z.coerce.string().datetime({ offset: true }), + contact_email: z.coerce.string().optional(), + }) + ), + }), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "appsListInstallationsForAuthenticatedUser", "/user/installations", @@ -65285,118 +67521,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - installations: z.array( - z.object({ - id: z.coerce.number(), - account: z.object({}), - repository_selection: z.enum(["all", "selected"]), - access_tokens_url: z.coerce.string(), - repositories_url: z.coerce.string(), - html_url: z.coerce.string(), - app_id: z.coerce.number(), - target_id: z.coerce.number(), - target_type: z.coerce.string(), - permissions: z.object({ - actions: z.enum(["read", "write"]).optional(), - administration: z.enum(["read", "write"]).optional(), - checks: z.enum(["read", "write"]).optional(), - contents: z.enum(["read", "write"]).optional(), - deployments: z.enum(["read", "write"]).optional(), - environments: z.enum(["read", "write"]).optional(), - issues: z.enum(["read", "write"]).optional(), - metadata: z.enum(["read", "write"]).optional(), - packages: z.enum(["read", "write"]).optional(), - pages: z.enum(["read", "write"]).optional(), - pull_requests: z.enum(["read", "write"]).optional(), - repository_announcement_banners: z - .enum(["read", "write"]) - .optional(), - repository_hooks: z.enum(["read", "write"]).optional(), - repository_projects: z - .enum(["read", "write", "admin"]) - .optional(), - secret_scanning_alerts: z - .enum(["read", "write"]) - .optional(), - secrets: z.enum(["read", "write"]).optional(), - security_events: z.enum(["read", "write"]).optional(), - single_file: z.enum(["read", "write"]).optional(), - statuses: z.enum(["read", "write"]).optional(), - vulnerability_alerts: z.enum(["read", "write"]).optional(), - workflows: z.enum(["write"]).optional(), - members: z.enum(["read", "write"]).optional(), - organization_administration: z - .enum(["read", "write"]) - .optional(), - organization_custom_roles: z - .enum(["read", "write"]) - .optional(), - organization_announcement_banners: z - .enum(["read", "write"]) - .optional(), - organization_hooks: z.enum(["read", "write"]).optional(), - organization_plan: z.enum(["read"]).optional(), - organization_projects: z - .enum(["read", "write", "admin"]) - .optional(), - organization_packages: z.enum(["read", "write"]).optional(), - organization_secrets: z.enum(["read", "write"]).optional(), - organization_self_hosted_runners: z - .enum(["read", "write"]) - .optional(), - organization_user_blocking: z - .enum(["read", "write"]) - .optional(), - team_discussions: z.enum(["read", "write"]).optional(), - }), - events: z.array(z.coerce.string()), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - single_file_name: z.coerce.string(), - has_multiple_single_files: z.coerce.boolean().optional(), - single_file_paths: z.array(z.coerce.string()).optional(), - app_slug: z.coerce.string(), - suspended_by: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - suspended_at: z.coerce.string().datetime({ offset: true }), - contact_email: z.coerce.string().optional(), - }) - ), - }), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsListInstallationsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65411,85 +67539,30 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "appsListInstallationReposForAuthenticatedUser", - "/user/installations/:installationId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - appsListInstallationReposForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - appsListInstallationReposForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.appsListInstallationReposForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( + const appsListInstallationReposForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.object({ - total_count: z.coerce.number(), - repository_selection: z.coerce.string().optional(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), + "200", + z.object({ + total_count: z.coerce.number(), + repository_selection: z.coerce.string().optional(), + repositories: z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -65511,244 +67584,305 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - }), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + }), ], - undefined - )(status, body) + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "appsListInstallationReposForAuthenticatedUser", + "/user/installations/:installationId/repositories", + async (ctx, next) => { + const input = { + params: parseRequestInput( + appsListInstallationReposForAuthenticatedUserParamSchema, + ctx.params + ), + query: parseRequestInput( + appsListInstallationReposForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.appsListInstallationReposForAuthenticatedUser( + input, + ctx + ) + + ctx.body = appsListInstallationReposForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65759,6 +67893,17 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const appsAddRepoToInstallationForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.put( "appsAddRepoToInstallationForAuthenticatedUser", "/user/installations/:installationId/repositories/:repositoryId", @@ -65778,15 +67923,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = appsAddRepoToInstallationForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65798,6 +67938,17 @@ export function bootstrap( repository_id: z.coerce.number(), }) + const appsRemoveRepoFromInstallationForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "appsRemoveRepoFromInstallationForAuthenticatedUser", "/user/installations/:installationId/repositories/:repositoryId", @@ -65817,20 +67968,25 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + appsRemoveRepoFromInstallationForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) + const interactionsGetRestrictionsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", z.object({})], + ["204", z.void()], + ], + undefined + ) + router.get( "interactionsGetRestrictionsForAuthenticatedUser", "/user/interaction-limits", @@ -65847,13 +68003,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", z.object({})], - ["204", z.void()], - ], - undefined - )(status, body) + ctx.body = + interactionsGetRestrictionsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65862,6 +68016,15 @@ export function bootstrap( const interactionsSetRestrictionsForAuthenticatedUserBodySchema = s_interaction_limit + const interactionsSetRestrictionsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_interaction_limit_response], + ["422", s_validation_error], + ], + undefined + ) + router.put( "interactionsSetRestrictionsForAuthenticatedUser", "/user/interaction-limits", @@ -65881,18 +68044,19 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_interaction_limit_response], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = + interactionsSetRestrictionsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) + const interactionsRemoveRestrictionsForAuthenticatedUserResponseValidator = + responseValidationFactory([["204", z.void()]], undefined) + router.delete( "interactionsRemoveRestrictionsForAuthenticatedUser", "/user/interaction-limits", @@ -65909,10 +68073,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["204", z.void()]], undefined)( - status, - body - ) + ctx.body = + interactionsRemoveRestrictionsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -65931,81 +68096,126 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "issuesListForAuthenticatedUser", - "/user/issues", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - issuesListForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.issuesListForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( + const issuesListForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -66028,170 +68238,76 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), created_at: z.coerce.string().datetime({ offset: true }), updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -66213,319 +68329,369 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - .optional(), - performed_via_github_app: z - .object({ + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - ), - ], - ["304", z.void()], - ["404", s_basic_error], + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "issuesListForAuthenticatedUser", + "/user/issues", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + issuesListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.issuesListForAuthenticatedUser(input, ctx) + + ctx.body = issuesListForAuthenticatedUserResponseValidator(status, body) ctx.status = status return next() } @@ -66536,6 +68702,31 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListPublicSshKeysForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + url: z.coerce.string(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + verified: z.coerce.boolean(), + read_only: z.coerce.boolean(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersListPublicSshKeysForAuthenticatedUser", "/user/keys", @@ -66555,29 +68746,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - url: z.coerce.string(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - verified: z.coerce.boolean(), - read_only: z.coerce.boolean(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListPublicSshKeysForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -66588,6 +68760,19 @@ export function bootstrap( key: z.coerce.string(), }) + const usersCreatePublicSshKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_key], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "usersCreatePublicSshKeyForAuthenticatedUser", "/user/keys", @@ -66607,17 +68792,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_key], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersCreatePublicSshKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -66627,51 +68805,370 @@ export function bootstrap( key_id: z.coerce.number(), }) + const usersGetPublicSshKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_key], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "usersGetPublicSshKeyForAuthenticatedUser", + "/user/keys/:keyId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + usersGetPublicSshKeyForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.usersGetPublicSshKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = usersGetPublicSshKeyForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const usersDeletePublicSshKeyForAuthenticatedUserParamSchema = z.object({ + key_id: z.coerce.number(), + }) + + const usersDeletePublicSshKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.delete( + "usersDeletePublicSshKeyForAuthenticatedUser", + "/user/keys/:keyId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + usersDeletePublicSshKeyForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.usersDeletePublicSshKeyForAuthenticatedUser( + input, + ctx + ) + + ctx.body = usersDeletePublicSshKeyForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const appsListSubscriptionsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const appsListSubscriptionsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + billing_cycle: z.coerce.string(), + next_billing_date: z.coerce.string().datetime({ offset: true }), + unit_count: z.coerce.number(), + on_free_trial: z.coerce.boolean(), + free_trial_ends_on: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + account: z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + type: z.coerce.string(), + node_id: z.coerce.string().optional(), + login: z.coerce.string(), + email: z.coerce.string().email().optional(), + organization_billing_email: z.coerce + .string() + .email() + .optional(), + }), + plan: z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "appsListSubscriptionsForAuthenticatedUser", + "/user/marketplace_purchases", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListSubscriptionsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.appsListSubscriptionsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = appsListSubscriptionsForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const appsListSubscriptionsForAuthenticatedUserStubbedResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + billing_cycle: z.coerce.string(), + next_billing_date: z.coerce.string().datetime({ offset: true }), + unit_count: z.coerce.number(), + on_free_trial: z.coerce.boolean(), + free_trial_ends_on: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + account: z.object({ + url: z.coerce.string(), + id: z.coerce.number(), + type: z.coerce.string(), + node_id: z.coerce.string().optional(), + login: z.coerce.string(), + email: z.coerce.string().email().optional(), + organization_billing_email: z.coerce + .string() + .email() + .optional(), + }), + plan: z.object({ + url: z.coerce.string(), + accounts_url: z.coerce.string(), + id: z.coerce.number(), + number: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + monthly_price_in_cents: z.coerce.number(), + yearly_price_in_cents: z.coerce.number(), + price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), + has_free_trial: z.coerce.boolean(), + unit_name: z.coerce.string(), + state: z.coerce.string(), + bullets: z.array(z.coerce.string()), + }), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ], + undefined + ) + + router.get( + "appsListSubscriptionsForAuthenticatedUserStubbed", + "/user/marketplace_purchases/stubbed", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.appsListSubscriptionsForAuthenticatedUserStubbed( + input, + ctx + ) + + ctx.body = + appsListSubscriptionsForAuthenticatedUserStubbedResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const orgsListMembershipsForAuthenticatedUserQuerySchema = z.object({ + state: z.enum(["active", "pending"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const orgsListMembershipsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + state: z.enum(["active", "pending"]), + role: z.enum(["admin", "member", "billing_manager"]), + organization_url: z.coerce.string(), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z + .object({ can_create_repository: z.coerce.boolean() }) + .optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( - "usersGetPublicSshKeyForAuthenticatedUser", - "/user/keys/:keyId", + "orgsListMembershipsForAuthenticatedUser", + "/user/memberships/orgs", async (ctx, next) => { const input = { - params: parseRequestInput( - usersGetPublicSshKeyForAuthenticatedUserParamSchema, - ctx.params + params: undefined, + query: parseRequestInput( + orgsListMembershipsForAuthenticatedUserQuerySchema, + ctx.query ), - query: undefined, body: undefined, } const { status, body } = - await implementation.usersGetPublicSshKeyForAuthenticatedUser( - input, - ctx - ) + await implementation.orgsListMembershipsForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_key], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsListMembershipsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const usersDeletePublicSshKeyForAuthenticatedUserParamSchema = z.object({ - key_id: z.coerce.number(), + const orgsGetMembershipForAuthenticatedUserParamSchema = z.object({ + org: z.coerce.string(), }) - router.delete( - "usersDeletePublicSshKeyForAuthenticatedUser", - "/user/keys/:keyId", + const orgsGetMembershipForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "orgsGetMembershipForAuthenticatedUser", + "/user/memberships/orgs/:org", async (ctx, next) => { const input = { params: parseRequestInput( - usersDeletePublicSshKeyForAuthenticatedUserParamSchema, + orgsGetMembershipForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -66679,351 +69176,428 @@ export function bootstrap( } const { status, body } = - await implementation.usersDeletePublicSshKeyForAuthenticatedUser( - input, - ctx - ) + await implementation.orgsGetMembershipForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsGetMembershipForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const appsListSubscriptionsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const orgsUpdateMembershipForAuthenticatedUserParamSchema = z.object({ + org: z.coerce.string(), }) - router.get( - "appsListSubscriptionsForAuthenticatedUser", - "/user/marketplace_purchases", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - appsListSubscriptionsForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.appsListSubscriptionsForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - billing_cycle: z.coerce.string(), - next_billing_date: z.coerce.string().datetime({ offset: true }), - unit_count: z.coerce.number(), - on_free_trial: z.coerce.boolean(), - free_trial_ends_on: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - account: z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - type: z.coerce.string(), - node_id: z.coerce.string().optional(), - login: z.coerce.string(), - email: z.coerce.string().email().optional(), - organization_billing_email: z.coerce - .string() - .email() - .optional(), - }), - plan: z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), + const orgsUpdateMembershipForAuthenticatedUserBodySchema = z.object({ + state: z.enum(["active"]), }) - router.get( - "appsListSubscriptionsForAuthenticatedUserStubbed", - "/user/marketplace_purchases/stubbed", + const orgsUpdateMembershipForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_org_membership], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.patch( + "orgsUpdateMembershipForAuthenticatedUser", + "/user/memberships/orgs/:org", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - appsListSubscriptionsForAuthenticatedUserStubbedQuerySchema, - ctx.query + params: parseRequestInput( + orgsUpdateMembershipForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: parseRequestInput( + orgsUpdateMembershipForAuthenticatedUserBodySchema, + ctx.body ), - body: undefined, } const { status, body } = - await implementation.appsListSubscriptionsForAuthenticatedUserStubbed( + await implementation.orgsUpdateMembershipForAuthenticatedUser( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - billing_cycle: z.coerce.string(), - next_billing_date: z.coerce.string().datetime({ offset: true }), - unit_count: z.coerce.number(), - on_free_trial: z.coerce.boolean(), - free_trial_ends_on: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - account: z.object({ - url: z.coerce.string(), - id: z.coerce.number(), - type: z.coerce.string(), - node_id: z.coerce.string().optional(), - login: z.coerce.string(), - email: z.coerce.string().email().optional(), - organization_billing_email: z.coerce - .string() - .email() - .optional(), - }), - plan: z.object({ - url: z.coerce.string(), - accounts_url: z.coerce.string(), - id: z.coerce.number(), - number: z.coerce.number(), - name: z.coerce.string(), - description: z.coerce.string(), - monthly_price_in_cents: z.coerce.number(), - yearly_price_in_cents: z.coerce.number(), - price_model: z.enum(["FREE", "FLAT_RATE", "PER_UNIT"]), - has_free_trial: z.coerce.boolean(), - unit_name: z.coerce.string(), - state: z.coerce.string(), - bullets: z.array(z.coerce.string()), - }), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsUpdateMembershipForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const orgsListMembershipsForAuthenticatedUserQuerySchema = z.object({ - state: z.enum(["active", "pending"]).optional(), + const migrationsListForAuthenticatedUserQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) - router.get( - "orgsListMembershipsForAuthenticatedUser", - "/user/memberships/orgs", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - orgsListMembershipsForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.orgsListMembershipsForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( + const migrationsListForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - state: z.enum(["active", "pending"]), - role: z.enum(["admin", "member", "billing_manager"]), - organization_url: z.coerce.string(), - organization: z.object({ - login: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + guid: z.coerce.string(), + state: z.coerce.string(), + lock_repositories: z.coerce.boolean(), + exclude_metadata: z.coerce.boolean(), + exclude_git_data: z.coerce.boolean(), + exclude_attachments: z.coerce.boolean(), + exclude_releases: z.coerce.boolean(), + exclude_owner_projects: z.coerce.boolean(), + org_metadata_only: z.coerce.boolean(), + repositories: z.array( + z.object({ id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), description: z.coerce.string(), - }), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + fork: z.coerce.boolean(), url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), starred_at: z.coerce.string().optional(), - }), - permissions: z - .object({ can_create_repository: z.coerce.boolean() }) - .optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsGetMembershipForAuthenticatedUserParamSchema = z.object({ - org: z.coerce.string(), - }) - - router.get( - "orgsGetMembershipForAuthenticatedUser", - "/user/memberships/orgs/:org", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsGetMembershipForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.orgsGetMembershipForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", s_org_membership], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsUpdateMembershipForAuthenticatedUserParamSchema = z.object({ - org: z.coerce.string(), - }) - - const orgsUpdateMembershipForAuthenticatedUserBodySchema = z.object({ - state: z.enum(["active"]), - }) - - router.patch( - "orgsUpdateMembershipForAuthenticatedUser", - "/user/memberships/orgs/:org", - async (ctx, next) => { - const input = { - params: parseRequestInput( - orgsUpdateMembershipForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: parseRequestInput( - orgsUpdateMembershipForAuthenticatedUserBodySchema, - ctx.body - ), - } - - const { status, body } = - await implementation.orgsUpdateMembershipForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["200", s_org_membership], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + node_id: z.coerce.string(), + archive_url: z.coerce.string().optional(), + exclude: z.array(z.object({})).optional(), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const migrationsListForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) router.get( "migrationsListForAuthenticatedUser", @@ -67041,363 +69615,10 @@ export function bootstrap( const { status, body } = await implementation.migrationsListForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - guid: z.coerce.string(), - state: z.coerce.string(), - lock_repositories: z.coerce.boolean(), - exclude_metadata: z.coerce.boolean(), - exclude_git_data: z.coerce.boolean(), - exclude_attachments: z.coerce.boolean(), - exclude_releases: z.coerce.boolean(), - exclude_owner_projects: z.coerce.boolean(), - org_metadata_only: z.coerce.boolean(), - repositories: z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - node_id: z.coerce.string(), - archive_url: z.coerce.string().optional(), - exclude: z.array(z.object({})).optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsListForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -67415,6 +69636,18 @@ export function bootstrap( repositories: z.array(z.coerce.string()), }) + const migrationsStartForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_migration], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "migrationsStartForAuthenticatedUser", "/user/migrations", @@ -67431,16 +69664,10 @@ export function bootstrap( const { status, body } = await implementation.migrationsStartForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_migration], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = migrationsStartForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -67454,6 +69681,18 @@ export function bootstrap( exclude: z.array(z.coerce.string()).optional(), }) + const migrationsGetStatusForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_migration], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "migrationsGetStatusForAuthenticatedUser", "/user/migrations/:migrationId", @@ -67473,16 +69712,10 @@ export function bootstrap( const { status, body } = await implementation.migrationsGetStatusForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_migration], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsGetStatusForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -67492,6 +69725,17 @@ export function bootstrap( migration_id: z.coerce.number(), }) + const migrationsGetArchiveForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["302", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "migrationsGetArchiveForAuthenticatedUser", "/user/migrations/:migrationId/archive", @@ -67511,15 +69755,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["302", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsGetArchiveForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -67529,6 +69768,18 @@ export function bootstrap( migration_id: z.coerce.number(), }) + const migrationsDeleteArchiveForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "migrationsDeleteArchiveForAuthenticatedUser", "/user/migrations/:migrationId/archive", @@ -67548,16 +69799,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsDeleteArchiveForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -67568,6 +69813,18 @@ export function bootstrap( repo_name: z.coerce.string(), }) + const migrationsUnlockRepoForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "migrationsUnlockRepoForAuthenticatedUser", "/user/migrations/:migrationId/repos/:repoName/lock", @@ -67587,16 +69844,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = migrationsUnlockRepoForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -67611,538 +69862,201 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "migrationsListReposForAuthenticatedUser", - "/user/migrations/:migrationId/repositories", - async (ctx, next) => { - const input = { - params: parseRequestInput( - migrationsListReposForAuthenticatedUserParamSchema, - ctx.params - ), - query: parseRequestInput( - migrationsListReposForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.migrationsListReposForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const orgsListForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "orgsListForAuthenticatedUser", - "/user/orgs", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - orgsListForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.orgsListForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( + const migrationsListReposForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), avatar_url: z.coerce.string(), - description: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const packagesListPackagesForAuthenticatedUserQuerySchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - visibility: z.enum(["public", "private", "internal"]).optional(), - }) - - router.get( - "packagesListPackagesForAuthenticatedUser", - "/user/packages", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - packagesListPackagesForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.packagesListPackagesForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), + gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const packagesGetPackageForAuthenticatedUserParamSchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), - }) + ["404", s_basic_error], + ], + undefined + ) router.get( - "packagesGetPackageForAuthenticatedUser", - "/user/packages/:packageType/:packageName", + "migrationsListReposForAuthenticatedUser", + "/user/migrations/:migrationId/repositories", async (ctx, next) => { const input = { params: parseRequestInput( - packagesGetPackageForAuthenticatedUserParamSchema, + migrationsListReposForAuthenticatedUserParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + migrationsListReposForAuthenticatedUserQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.packagesGetPackageForAuthenticatedUser(input, ctx) + await implementation.migrationsListReposForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory([["200", s_package]], undefined)( + ctx.body = migrationsListReposForAuthenticatedUserResponseValidator( status, body ) @@ -68151,52 +70065,63 @@ export function bootstrap( } ) - const packagesDeletePackageForAuthenticatedUserParamSchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), + const orgsListForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), }) - router.delete( - "packagesDeletePackageForAuthenticatedUser", - "/user/packages/:packageType/:packageName", + const orgsListForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + + router.get( + "orgsListForAuthenticatedUser", + "/user/orgs", async (ctx, next) => { const input = { - params: parseRequestInput( - packagesDeletePackageForAuthenticatedUserParamSchema, - ctx.params + params: undefined, + query: parseRequestInput( + orgsListForAuthenticatedUserQuerySchema, + ctx.query ), - query: undefined, body: undefined, } const { status, body } = - await implementation.packagesDeletePackageForAuthenticatedUser( - input, - ctx - ) + await implementation.orgsListForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = orgsListForAuthenticatedUserResponseValidator(status, body) ctx.status = status return next() } ) - const packagesRestorePackageForAuthenticatedUserParamSchema = z.object({ + const packagesListPackagesForAuthenticatedUserQuerySchema = z.object({ package_type: z.enum([ "npm", "maven", @@ -68205,143 +70130,297 @@ export function bootstrap( "nuget", "container", ]), - package_name: z.coerce.string(), + visibility: z.enum(["public", "private", "internal"]).optional(), }) - const packagesRestorePackageForAuthenticatedUserQuerySchema = z.object({ - token: z.coerce.string().optional(), - }) + const packagesListPackagesForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + url: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) - router.post( - "packagesRestorePackageForAuthenticatedUser", - "/user/packages/:packageType/:packageName/restore", + router.get( + "packagesListPackagesForAuthenticatedUser", + "/user/packages", async (ctx, next) => { const input = { - params: parseRequestInput( - packagesRestorePackageForAuthenticatedUserParamSchema, - ctx.params - ), + params: undefined, query: parseRequestInput( - packagesRestorePackageForAuthenticatedUserQuerySchema, + packagesListPackagesForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.packagesRestorePackageForAuthenticatedUser( + await implementation.packagesListPackagesForAuthenticatedUser( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesListPackagesForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserParamSchema = - z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - package_name: z.coerce.string(), - }) + const packagesGetPackageForAuthenticatedUserParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + }) - const packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQuerySchema = - z.object({ - page: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - state: z.enum(["active", "deleted"]).optional(), - }) + const packagesGetPackageForAuthenticatedUserResponseValidator = + responseValidationFactory([["200", s_package]], undefined) router.get( - "packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser", - "/user/packages/:packageType/:packageName/versions", + "packagesGetPackageForAuthenticatedUser", + "/user/packages/:packageType/:packageName", async (ctx, next) => { const input = { params: parseRequestInput( - packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserParamSchema, + packagesGetPackageForAuthenticatedUserParamSchema, ctx.params ), - query: parseRequestInput( - packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQuerySchema, - ctx.query - ), + query: undefined, body: undefined, } const { status, body } = - await implementation.packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser( - input, - ctx - ) + await implementation.packagesGetPackageForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - ), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesGetPackageForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const packagesGetPackageVersionForAuthenticatedUserParamSchema = z.object({ + const packagesDeletePackageForAuthenticatedUserParamSchema = z.object({ package_type: z.enum([ "npm", "maven", @@ -68351,16 +70430,26 @@ export function bootstrap( "container", ]), package_name: z.coerce.string(), - package_version_id: z.coerce.number(), }) - router.get( - "packagesGetPackageVersionForAuthenticatedUser", - "/user/packages/:packageType/:packageName/versions/:packageVersionId", + const packagesDeletePackageForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.delete( + "packagesDeletePackageForAuthenticatedUser", + "/user/packages/:packageType/:packageName", async (ctx, next) => { const input = { params: parseRequestInput( - packagesGetPackageVersionForAuthenticatedUserParamSchema, + packagesDeletePackageForAuthenticatedUserParamSchema, ctx.params ), query: undefined, @@ -68368,21 +70457,21 @@ export function bootstrap( } const { status, body } = - await implementation.packagesGetPackageVersionForAuthenticatedUser( + await implementation.packagesDeletePackageForAuthenticatedUser( input, ctx ) - ctx.body = responseValidationFactory( - [["200", s_package_version]], - undefined - )(status, body) + ctx.body = packagesDeletePackageForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const packagesDeletePackageVersionForAuthenticatedUserParamSchema = z.object({ + const packagesRestorePackageForAuthenticatedUserParamSchema = z.object({ package_type: z.enum([ "npm", "maven", @@ -68392,44 +70481,56 @@ export function bootstrap( "container", ]), package_name: z.coerce.string(), - package_version_id: z.coerce.number(), }) - router.delete( - "packagesDeletePackageVersionForAuthenticatedUser", - "/user/packages/:packageType/:packageName/versions/:packageVersionId", + const packagesRestorePackageForAuthenticatedUserQuerySchema = z.object({ + token: z.coerce.string().optional(), + }) + + const packagesRestorePackageForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.post( + "packagesRestorePackageForAuthenticatedUser", + "/user/packages/:packageType/:packageName/restore", async (ctx, next) => { const input = { params: parseRequestInput( - packagesDeletePackageVersionForAuthenticatedUserParamSchema, + packagesRestorePackageForAuthenticatedUserParamSchema, ctx.params ), - query: undefined, + query: parseRequestInput( + packagesRestorePackageForAuthenticatedUserQuerySchema, + ctx.query + ), body: undefined, } const { status, body } = - await implementation.packagesDeletePackageVersionForAuthenticatedUser( + await implementation.packagesRestorePackageForAuthenticatedUser( input, ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesRestorePackageForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const packagesRestorePackageVersionForAuthenticatedUserParamSchema = z.object( - { + const packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserParamSchema = + z.object({ package_type: z.enum([ "npm", "maven", @@ -68439,641 +70540,575 @@ export function bootstrap( "container", ]), package_name: z.coerce.string(), - package_version_id: z.coerce.number(), - } - ) - - router.post( - "packagesRestorePackageVersionForAuthenticatedUser", - "/user/packages/:packageType/:packageName/versions/:packageVersionId/restore", - async (ctx, next) => { - const input = { - params: parseRequestInput( - packagesRestorePackageVersionForAuthenticatedUserParamSchema, - ctx.params - ), - query: undefined, - body: undefined, - } - - const { status, body } = - await implementation.packagesRestorePackageVersionForAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const projectsCreateForAuthenticatedUserBodySchema = z.object({ - name: z.coerce.string(), - body: z.coerce.string().optional(), - }) - - router.post( - "projectsCreateForAuthenticatedUser", - "/user/projects", - async (ctx, next) => { - const input = { - params: undefined, - query: undefined, - body: parseRequestInput( - projectsCreateForAuthenticatedUserBodySchema, - ctx.body - ), - } + }) - const { status, body } = - await implementation.projectsCreateForAuthenticatedUser(input, ctx) + const packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQuerySchema = + z.object({ + page: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + state: z.enum(["active", "deleted"]).optional(), + }) - ctx.body = responseValidationFactory( + const packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - ["201", s_project], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error_simple], + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const usersListPublicEmailsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) router.get( - "usersListPublicEmailsForAuthenticatedUser", - "/user/public_emails", + "packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser", + "/user/packages/:packageType/:packageName/versions", async (ctx, next) => { const input = { - params: undefined, + params: parseRequestInput( + packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserParamSchema, + ctx.params + ), query: parseRequestInput( - usersListPublicEmailsForAuthenticatedUserQuerySchema, + packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.usersListPublicEmailsForAuthenticatedUser( + await implementation.packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser( input, ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - email: z.coerce.string().email(), - primary: z.coerce.boolean(), - verified: z.coerce.boolean(), - visibility: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const reposListForAuthenticatedUserQuerySchema = z.object({ - visibility: z.enum(["all", "public", "private"]).optional(), - affiliation: z.coerce.string().optional(), - type: z.enum(["all", "owner", "public", "private", "member"]).optional(), - sort: z.enum(["created", "updated", "pushed", "full_name"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - since: z.coerce.string().datetime({ offset: true }).optional(), - before: z.coerce.string().datetime({ offset: true }).optional(), + const packagesGetPackageVersionForAuthenticatedUserParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + package_version_id: z.coerce.number(), }) + const packagesGetPackageVersionForAuthenticatedUserResponseValidator = + responseValidationFactory([["200", s_package_version]], undefined) + router.get( - "reposListForAuthenticatedUser", - "/user/repos", + "packagesGetPackageVersionForAuthenticatedUser", + "/user/packages/:packageType/:packageName/versions/:packageVersionId", async (ctx, next) => { const input = { - params: undefined, - query: parseRequestInput( - reposListForAuthenticatedUserQuerySchema, - ctx.query + params: parseRequestInput( + packagesGetPackageVersionForAuthenticatedUserParamSchema, + ctx.params ), - body: undefined, - } - - const { status, body } = - await implementation.reposListForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.packagesGetPackageVersionForAuthenticatedUser( + input, + ctx + ) + + ctx.body = packagesGetPackageVersionForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const reposCreateForAuthenticatedUserBodySchema = z.object({ + const packagesDeletePackageVersionForAuthenticatedUserParamSchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + package_version_id: z.coerce.number(), + }) + + const packagesDeletePackageVersionForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.delete( + "packagesDeletePackageVersionForAuthenticatedUser", + "/user/packages/:packageType/:packageName/versions/:packageVersionId", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesDeletePackageVersionForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.packagesDeletePackageVersionForAuthenticatedUser( + input, + ctx + ) + + ctx.body = + packagesDeletePackageVersionForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const packagesRestorePackageVersionForAuthenticatedUserParamSchema = z.object( + { + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + package_name: z.coerce.string(), + package_version_id: z.coerce.number(), + } + ) + + const packagesRestorePackageVersionForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.post( + "packagesRestorePackageVersionForAuthenticatedUser", + "/user/packages/:packageType/:packageName/versions/:packageVersionId/restore", + async (ctx, next) => { + const input = { + params: parseRequestInput( + packagesRestorePackageVersionForAuthenticatedUserParamSchema, + ctx.params + ), + query: undefined, + body: undefined, + } + + const { status, body } = + await implementation.packagesRestorePackageVersionForAuthenticatedUser( + input, + ctx + ) + + ctx.body = + packagesRestorePackageVersionForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const projectsCreateForAuthenticatedUserBodySchema = z.object({ name: z.coerce.string(), - description: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - private: z.coerce.boolean().optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - team_id: z.coerce.number().optional(), - auto_init: z.coerce.boolean().optional(), - gitignore_template: z.coerce.string().optional(), - license_template: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), - merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), - has_downloads: z.coerce.boolean().optional(), - is_template: z.coerce.boolean().optional(), + body: z.coerce.string().optional(), }) + const projectsCreateForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_project], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error_simple], + ], + undefined + ) + router.post( - "reposCreateForAuthenticatedUser", - "/user/repos", + "projectsCreateForAuthenticatedUser", + "/user/projects", async (ctx, next) => { const input = { params: undefined, query: undefined, body: parseRequestInput( - reposCreateForAuthenticatedUserBodySchema, + projectsCreateForAuthenticatedUserBodySchema, ctx.body ), } const { status, body } = - await implementation.reposCreateForAuthenticatedUser(input, ctx) + await implementation.projectsCreateForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["201", s_repository], - ["304", z.void()], - ["400", s_scim_error], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = projectsCreateForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } ) - const reposListInvitationsForAuthenticatedUserQuerySchema = z.object({ + const usersListPublicEmailsForAuthenticatedUserQuerySchema = z.object({ per_page: z.coerce.number().optional(), page: z.coerce.number().optional(), }) + const usersListPublicEmailsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + email: z.coerce.string().email(), + primary: z.coerce.boolean(), + verified: z.coerce.boolean(), + visibility: z.coerce.string(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( - "reposListInvitationsForAuthenticatedUser", - "/user/repository_invitations", + "usersListPublicEmailsForAuthenticatedUser", + "/user/public_emails", async (ctx, next) => { const input = { params: undefined, query: parseRequestInput( - reposListInvitationsForAuthenticatedUserQuerySchema, + usersListPublicEmailsForAuthenticatedUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.reposListInvitationsForAuthenticatedUser( + await implementation.usersListPublicEmailsForAuthenticatedUser( input, ctx ) - ctx.body = responseValidationFactory( + ctx.body = usersListPublicEmailsForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListForAuthenticatedUserQuerySchema = z.object({ + visibility: z.enum(["all", "public", "private"]).optional(), + affiliation: z.coerce.string().optional(), + type: z.enum(["all", "owner", "public", "private", "member"]).optional(), + sort: z.enum(["created", "updated", "pushed", "full_name"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + since: z.coerce.string().datetime({ offset: true }).optional(), + before: z.coerce.string().datetime({ offset: true }).optional(), + }) + + const reposListForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - repository: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), clone_url: z.coerce.string().optional(), mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), + hooks_url: z.coerce.string().optional(), svn_url: z.coerce.string().optional(), homepage: z.coerce.string().optional(), language: z.coerce.string().optional(), @@ -69090,22 +71125,12 @@ export function bootstrap( has_wiki: z.coerce.boolean().optional(), has_pages: z.coerce.boolean().optional(), has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), archived: z.coerce.boolean().optional(), disabled: z.coerce.boolean().optional(), visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), permissions: z .object({ admin: z.coerce.boolean().optional(), @@ -69115,78 +71140,176 @@ export function bootstrap( pull: z.coerce.boolean().optional(), }) .optional(), - role_name: z.coerce.string().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) .optional(), - }), - invitee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - inviter: z.object({ + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.get( + "reposListForAuthenticatedUser", + "/user/repos", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + reposListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListForAuthenticatedUser(input, ctx) + + ctx.body = reposListForAuthenticatedUserResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposCreateForAuthenticatedUserBodySchema = z.object({ + name: z.coerce.string(), + description: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + private: z.coerce.boolean().optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + team_id: z.coerce.number().optional(), + auto_init: z.coerce.boolean().optional(), + gitignore_template: z.coerce.string().optional(), + license_template: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), + merge_commit_message: z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), + has_downloads: z.coerce.boolean().optional(), + is_template: z.coerce.boolean().optional(), + }) + + const reposCreateForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_repository], + ["304", z.void()], + ["400", s_scim_error], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + + router.post( + "reposCreateForAuthenticatedUser", + "/user/repos", + async (ctx, next) => { + const input = { + params: undefined, + query: undefined, + body: parseRequestInput( + reposCreateForAuthenticatedUserBodySchema, + ctx.body + ), + } + + const { status, body } = + await implementation.reposCreateForAuthenticatedUser(input, ctx) + + ctx.body = reposCreateForAuthenticatedUserResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const reposListInvitationsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const reposListInvitationsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + repository: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -69209,28 +71332,232 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - permissions: z.enum([ - "read", - "write", - "admin", - "triage", - "maintain", - ]), - created_at: z.coerce.string().datetime({ offset: true }), - expired: z.coerce.boolean().optional(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }), + invitee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + inviter: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), node_id: z.coerce.string(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + permissions: z.enum([ + "read", + "write", + "admin", + "triage", + "maintain", + ]), + created_at: z.coerce.string().datetime({ offset: true }), + expired: z.coerce.boolean().optional(), + url: z.coerce.string(), + html_url: z.coerce.string(), + node_id: z.coerce.string(), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "reposListInvitationsForAuthenticatedUser", + "/user/repository_invitations", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + reposListInvitationsForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.reposListInvitationsForAuthenticatedUser( + input, + ctx + ) + + ctx.body = reposListInvitationsForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69240,6 +71567,18 @@ export function bootstrap( invitation_id: z.coerce.number(), }) + const reposAcceptInvitationForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ], + undefined + ) + router.patch( "reposAcceptInvitationForAuthenticatedUser", "/user/repository_invitations/:invitationId", @@ -69259,16 +71598,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["409", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposAcceptInvitationForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69278,6 +71611,18 @@ export function bootstrap( invitation_id: z.coerce.number(), }) + const reposDeclineInvitationForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ["409", s_basic_error], + ], + undefined + ) + router.delete( "reposDeclineInvitationForAuthenticatedUser", "/user/repository_invitations/:invitationId", @@ -69297,16 +71642,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ["409", s_basic_error], - ], - undefined - )(status, body) + ctx.body = reposDeclineInvitationForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69317,6 +71656,28 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListSshSigningKeysForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersListSshSigningKeysForAuthenticatedUser", "/user/ssh_signing_keys", @@ -69336,26 +71697,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersListSshSigningKeysForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69366,6 +71711,19 @@ export function bootstrap( key: z.coerce.string(), }) + const usersCreateSshSigningKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["201", s_ssh_signing_key], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.post( "usersCreateSshSigningKeyForAuthenticatedUser", "/user/ssh_signing_keys", @@ -69385,17 +71743,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["201", s_ssh_signing_key], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersCreateSshSigningKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69405,6 +71756,18 @@ export function bootstrap( ssh_signing_key_id: z.coerce.number(), }) + const usersGetSshSigningKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["200", s_ssh_signing_key], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "usersGetSshSigningKeyForAuthenticatedUser", "/user/ssh_signing_keys/:sshSigningKeyId", @@ -69424,16 +71787,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_ssh_signing_key], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = usersGetSshSigningKeyForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69443,6 +71800,18 @@ export function bootstrap( ssh_signing_key_id: z.coerce.number(), }) + const usersDeleteSshSigningKeyForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "usersDeleteSshSigningKeyForAuthenticatedUser", "/user/ssh_signing_keys/:sshSigningKeyId", @@ -69462,103 +71831,45 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const activityListReposStarredByAuthenticatedUserQuerySchema = z.object({ - sort: z.enum(["created", "updated"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListReposStarredByAuthenticatedUser", - "/user/starred", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - activityListReposStarredByAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListReposStarredByAuthenticatedUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - starred_at: z.coerce.string().datetime({ offset: true }), - repo: z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ + ctx.body = usersDeleteSshSigningKeyForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const activityListReposStarredByAuthenticatedUserQuerySchema = z.object({ + sort: z.enum(["created", "updated"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const activityListReposStarredByAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + starred_at: z.coerce.string().datetime({ offset: true }), + repo: z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -69580,244 +71891,302 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce.string().optional(), - organizations_url: z.coerce.string().optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce.string().optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce.boolean().optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce.boolean().optional(), }), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce.string().optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce.boolean().optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }), + }) + ), ], - undefined - )(status, body) + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + + router.get( + "activityListReposStarredByAuthenticatedUser", + "/user/starred", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + activityListReposStarredByAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListReposStarredByAuthenticatedUser( + input, + ctx + ) + + ctx.body = activityListReposStarredByAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69828,6 +72197,18 @@ export function bootstrap( repo: z.coerce.string(), }) + const activityCheckRepoIsStarredByAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "activityCheckRepoIsStarredByAuthenticatedUser", "/user/starred/:owner/:repo", @@ -69847,16 +72228,10 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityCheckRepoIsStarredByAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69867,6 +72242,18 @@ export function bootstrap( repo: z.coerce.string(), }) + const activityStarRepoForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.put( "activityStarRepoForAuthenticatedUser", "/user/starred/:owner/:repo", @@ -69883,16 +72270,10 @@ export function bootstrap( const { status, body } = await implementation.activityStarRepoForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityStarRepoForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69903,6 +72284,18 @@ export function bootstrap( repo: z.coerce.string(), }) + const activityUnstarRepoForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "activityUnstarRepoForAuthenticatedUser", "/user/starred/:owner/:repo", @@ -69919,16 +72312,10 @@ export function bootstrap( const { status, body } = await implementation.activityUnstarRepoForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = activityUnstarRepoForAuthenticatedUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -69939,6 +72326,183 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const activityListWatchedReposForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ["304", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ], + undefined + ) + router.get( "activityListWatchedReposForAuthenticatedUser", "/user/subscriptions", @@ -69958,417 +72522,1000 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( + ctx.body = activityListWatchedReposForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const teamsListForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const teamsListForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + name: z.coerce.string(), + slug: z.coerce.string(), + description: z.coerce.string(), + privacy: z.enum(["closed", "secret"]).optional(), + permission: z.coerce.string(), + members_url: z.coerce.string(), + repositories_url: z.coerce.string(), + parent: z + .object({ id: z.coerce.number(), node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), url: z.coerce.string(), + members_url: z.coerce.string(), + name: z.coerce.string(), + description: z.coerce.string(), + permission: z.coerce.string(), + privacy: z.coerce.string().optional(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), + repositories_url: z.coerce.string(), + slug: z.coerce.string(), + ldap_dn: z.coerce.string().optional(), + }) + .optional(), + members_count: z.coerce.number(), + repos_count: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization: z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + name: z.coerce.string().optional(), + company: z.coerce.string().optional(), + blog: z.coerce.string().optional(), + location: z.coerce.string().optional(), + email: z.coerce.string().email().optional(), + twitter_username: z.coerce.string().optional(), + is_verified: z.coerce.boolean().optional(), + has_organization_projects: z.coerce.boolean(), + has_repository_projects: z.coerce.boolean(), + public_repos: z.coerce.number(), + public_gists: z.coerce.number(), + followers: z.coerce.number(), + following: z.coerce.number(), + html_url: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + type: z.coerce.string(), + total_private_repos: z.coerce.number().optional(), + owned_private_repos: z.coerce.number().optional(), + private_gists: z.coerce.number().optional(), + disk_usage: z.coerce.number().optional(), + collaborators: z.coerce.number().optional(), + billing_email: z.coerce.string().email().optional(), + plan: z + .object({ + name: z.coerce.string(), + space: z.coerce.number(), + private_repos: z.coerce.number(), + filled_seats: z.coerce.number().optional(), + seats: z.coerce.number().optional(), + }) .optional(), - created_at: z.coerce + default_repository_permission: z.coerce.string().optional(), + members_can_create_repositories: z.coerce.boolean().optional(), + two_factor_requirement_enabled: z.coerce.boolean().optional(), + members_allowed_repository_creation_type: z.coerce .string() - .datetime({ offset: true }) .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) + members_can_create_public_repositories: z.coerce + .boolean() .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) + members_can_create_private_repositories: z.coerce + .boolean() .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + members_can_create_internal_repositories: z.coerce + .boolean() + .optional(), + members_can_create_pages: z.coerce.boolean().optional(), + members_can_create_public_pages: z.coerce.boolean().optional(), + members_can_create_private_pages: z.coerce.boolean().optional(), + members_can_fork_private_repositories: z.coerce + .boolean() + .optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + updated_at: z.coerce.string().datetime({ offset: true }), + }), + ldap_dn: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + + router.get( + "teamsListForAuthenticatedUser", + "/user/teams", + async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput( + teamsListForAuthenticatedUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.teamsListForAuthenticatedUser(input, ctx) + + ctx.body = teamsListForAuthenticatedUserResponseValidator(status, body) + ctx.status = status + return next() + } + ) + + const usersListQuerySchema = z.object({ + since: z.coerce.number().optional(), + per_page: z.coerce.number().optional(), + }) + + const usersListResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ["304", z.void()], + ], + undefined + ) + + router.get("usersList", "/users", async (ctx, next) => { + const input = { + params: undefined, + query: parseRequestInput(usersListQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.usersList(input, ctx) + + ctx.body = usersListResponseValidator(status, body) + ctx.status = status + return next() + }) + + const usersGetByUsernameParamSchema = z.object({ + username: z.coerce.string(), + }) + + const usersGetByUsernameResponseValidator = responseValidationFactory( + [ + ["200", z.union([s_private_user, s_public_user])], + ["404", s_basic_error], + ], + undefined + ) + + router.get("usersGetByUsername", "/users/:username", async (ctx, next) => { + const input = { + params: parseRequestInput(usersGetByUsernameParamSchema, ctx.params), + query: undefined, + body: undefined, + } + + const { status, body } = await implementation.usersGetByUsername(input, ctx) + + ctx.body = usersGetByUsernameResponseValidator(status, body) + ctx.status = status + return next() + }) + + const activityListEventsForAuthenticatedUserParamSchema = z.object({ + username: z.coerce.string(), + }) + + const activityListEventsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const activityListEventsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), + html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + number: z.coerce.number(), + state: z.enum(["open", "closed"]), + title: z.coerce.string(), + description: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), }) .optional(), - secret_scanning: z + performed_via_github_app: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) .optional(), - secret_scanning_push_protection: z + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z .object({ - status: z.enum(["enabled", "disabled"]).optional(), + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) .optional(), }) .optional(), - }) - ), - ], - ["304", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const teamsListForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "teamsListForAuthenticatedUser", - "/user/teams", - async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput( - teamsListForAuthenticatedUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.teamsListForAuthenticatedUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - name: z.coerce.string(), - slug: z.coerce.string(), - description: z.coerce.string(), - privacy: z.enum(["closed", "secret"]).optional(), - permission: z.coerce.string(), - members_url: z.coerce.string(), - repositories_url: z.coerce.string(), - parent: z + comment: z .object({ id: z.coerce.number(), node_id: z.coerce.string(), url: z.coerce.string(), - members_url: z.coerce.string(), - name: z.coerce.string(), - description: z.coerce.string(), - permission: z.coerce.string(), - privacy: z.coerce.string().optional(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - repositories_url: z.coerce.string(), - slug: z.coerce.string(), - ldap_dn: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), }) .optional(), - members_count: z.coerce.number(), - repos_count: z.coerce.number(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization: z.object({ - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), - name: z.coerce.string().optional(), - company: z.coerce.string().optional(), - blog: z.coerce.string().optional(), - location: z.coerce.string().optional(), - email: z.coerce.string().email().optional(), - twitter_username: z.coerce.string().optional(), - is_verified: z.coerce.boolean().optional(), - has_organization_projects: z.coerce.boolean(), - has_repository_projects: z.coerce.boolean(), - public_repos: z.coerce.number(), - public_gists: z.coerce.number(), - followers: z.coerce.number(), - following: z.coerce.number(), - html_url: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - type: z.coerce.string(), - total_private_repos: z.coerce.number().optional(), - owned_private_repos: z.coerce.number().optional(), - private_gists: z.coerce.number().optional(), - disk_usage: z.coerce.number().optional(), - collaborators: z.coerce.number().optional(), - billing_email: z.coerce.string().email().optional(), - plan: z - .object({ - name: z.coerce.string(), - space: z.coerce.number(), - private_repos: z.coerce.number(), - filled_seats: z.coerce.number().optional(), - seats: z.coerce.number().optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), }) - .optional(), - default_repository_permission: z.coerce.string().optional(), - members_can_create_repositories: z.coerce - .boolean() - .optional(), - two_factor_requirement_enabled: z.coerce.boolean().optional(), - members_allowed_repository_creation_type: z.coerce - .string() - .optional(), - members_can_create_public_repositories: z.coerce - .boolean() - .optional(), - members_can_create_private_repositories: z.coerce - .boolean() - .optional(), - members_can_create_internal_repositories: z.coerce - .boolean() - .optional(), - members_can_create_pages: z.coerce.boolean().optional(), - members_can_create_public_pages: z.coerce - .boolean() - .optional(), - members_can_create_private_pages: z.coerce - .boolean() - .optional(), - members_can_fork_private_repositories: z.coerce - .boolean() - .optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - updated_at: z.coerce.string().datetime({ offset: true }), - }), - ldap_dn: z.coerce.string().optional(), - }) - ), - ], - ["304", z.void()], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const usersListQuerySchema = z.object({ - since: z.coerce.number().optional(), - per_page: z.coerce.number().optional(), - }) - - router.get("usersList", "/users", async (ctx, next) => { - const input = { - params: undefined, - query: parseRequestInput(usersListQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.usersList(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), }) ), ], - ["304", z.void()], - ], - undefined - )(status, body) - ctx.status = status - return next() - }) - - const usersGetByUsernameParamSchema = z.object({ - username: z.coerce.string(), - }) - - router.get("usersGetByUsername", "/users/:username", async (ctx, next) => { - const input = { - params: parseRequestInput(usersGetByUsernameParamSchema, ctx.params), - query: undefined, - body: undefined, - } - - const { status, body } = await implementation.usersGetByUsername(input, ctx) - - ctx.body = responseValidationFactory( - [ - ["200", z.union([s_private_user, s_public_user])], - ["404", s_basic_error], ], undefined - )(status, body) - ctx.status = status - return next() - }) - - const activityListEventsForAuthenticatedUserParamSchema = z.object({ - username: z.coerce.string(), - }) - - const activityListEventsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ) router.get( "activityListEventsForAuthenticatedUser", @@ -70389,57 +73536,174 @@ export function bootstrap( const { status, body } = await implementation.activityListEventsForAuthenticatedUser(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = activityListEventsForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const activityListOrgEventsForAuthenticatedUserParamSchema = z.object({ + username: z.coerce.string(), + org: z.coerce.string(), + }) + + const activityListOrgEventsForAuthenticatedUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const activityListOrgEventsForAuthenticatedUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -70462,21 +73726,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -70498,10 +73775,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -70524,19 +73818,411 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -70559,615 +74245,68 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const activityListOrgEventsForAuthenticatedUserParamSchema = z.object({ - username: z.coerce.string(), - org: z.coerce.string(), - }) - - const activityListOrgEventsForAuthenticatedUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ], + undefined + ) router.get( "activityListOrgEventsForAuthenticatedUser", @@ -71191,57 +74330,173 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( + ctx.body = activityListOrgEventsForAuthenticatedUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const activityListPublicEventsForUserParamSchema = z.object({ + username: z.coerce.string(), + }) + + const activityListPublicEventsForUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const activityListPublicEventsForUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -71264,21 +74519,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -71300,10 +74568,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -71326,19 +74611,18 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -71361,782 +74645,253 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const activityListPublicEventsForUserParamSchema = z.object({ - username: z.coerce.string(), - }) - - const activityListPublicEventsForUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) - - router.get( - "activityListPublicEventsForUser", - "/users/:username/events/public", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListPublicEventsForUserParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListPublicEventsForUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListPublicEventsForUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z - .object({ - id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), - events_url: z.coerce.string(), - html_url: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), - title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ id: z.coerce.number().optional(), node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), - html_url: z.coerce.string(), - labels_url: z.coerce.string(), + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -72159,601 +74914,213 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), - slug: z.coerce.string().optional(), node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) + ], + undefined + ) + + router.get( + "activityListPublicEventsForUser", + "/users/:username/events/public", + async (ctx, next) => { + const input = { + params: parseRequestInput( + activityListPublicEventsForUserParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListPublicEventsForUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListPublicEventsForUser(input, ctx) + + ctx.body = activityListPublicEventsForUserResponseValidator(status, body) ctx.status = status return next() } @@ -72768,6 +75135,40 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListFollowersForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "usersListFollowersForUser", "/users/:username/followers", @@ -72789,39 +75190,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = usersListFollowersForUserResponseValidator(status, body) ctx.status = status return next() } @@ -72836,6 +75205,40 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListFollowingForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ), + ], + ], + undefined + ) + router.get( "usersListFollowingForUser", "/users/:username/following", @@ -72857,39 +75260,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = usersListFollowingForUserResponseValidator(status, body) ctx.status = status return next() } @@ -72900,6 +75271,14 @@ export function bootstrap( target_user: z.coerce.string(), }) + const usersCheckFollowingForUserResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["404", z.void()], + ], + undefined + ) + router.get( "usersCheckFollowingForUser", "/users/:username/following/:targetUser", @@ -72918,13 +75297,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["404", z.void()], - ], - undefined - )(status, body) + ctx.body = usersCheckFollowingForUserResponseValidator(status, body) ctx.status = status return next() } @@ -72938,6 +75311,86 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const gistsListForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + url: z.coerce.string(), + forks_url: z.coerce.string(), + commits_url: z.coerce.string(), + id: z.coerce.string(), + node_id: z.coerce.string(), + git_pull_url: z.coerce.string(), + git_push_url: z.coerce.string(), + html_url: z.coerce.string(), + files: z.object({}), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + description: z.coerce.string(), + comments: z.coerce.number(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + comments_url: z.coerce.string(), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + truncated: z.coerce.boolean().optional(), + forks: z.array(z.object({})).optional(), + history: z.array(z.object({})).optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + router.get( "gistsListForUser", "/users/:username/gists", @@ -72950,85 +75403,7 @@ export function bootstrap( const { status, body } = await implementation.gistsListForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - url: z.coerce.string(), - forks_url: z.coerce.string(), - commits_url: z.coerce.string(), - id: z.coerce.string(), - node_id: z.coerce.string(), - git_pull_url: z.coerce.string(), - git_push_url: z.coerce.string(), - html_url: z.coerce.string(), - files: z.object({}), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - description: z.coerce.string(), - comments: z.coerce.number(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - comments_url: z.coerce.string(), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - truncated: z.coerce.boolean().optional(), - forks: z.array(z.object({})).optional(), - history: z.array(z.object({})).optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = gistsListForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73043,6 +75418,56 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListGpgKeysForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string().optional(), + primary_key_id: z.coerce.number(), + key_id: z.coerce.string(), + public_key: z.coerce.string(), + emails: z.array( + z.object({ + email: z.coerce.string().optional(), + verified: z.coerce.boolean().optional(), + }) + ), + subkeys: z.array( + z.object({ + id: z.coerce.number().optional(), + primary_key_id: z.coerce.number().optional(), + key_id: z.coerce.string().optional(), + public_key: z.coerce.string().optional(), + emails: z.array(z.object({})).optional(), + subkeys: z.array(z.object({})).optional(), + can_sign: z.coerce.boolean().optional(), + can_encrypt_comms: z.coerce.boolean().optional(), + can_encrypt_storage: z.coerce.boolean().optional(), + can_certify: z.coerce.boolean().optional(), + created_at: z.coerce.string().optional(), + expires_at: z.coerce.string().optional(), + raw_key: z.coerce.string().optional(), + revoked: z.coerce.boolean().optional(), + }) + ), + can_sign: z.coerce.boolean(), + can_encrypt_comms: z.coerce.boolean(), + can_encrypt_storage: z.coerce.boolean(), + can_certify: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + expires_at: z.coerce.string().datetime({ offset: true }), + revoked: z.coerce.boolean(), + raw_key: z.coerce.string(), + }) + ), + ], + ], + undefined + ) + router.get( "usersListGpgKeysForUser", "/users/:username/gpg_keys", @@ -73061,55 +75486,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string().optional(), - primary_key_id: z.coerce.number(), - key_id: z.coerce.string(), - public_key: z.coerce.string(), - emails: z.array( - z.object({ - email: z.coerce.string().optional(), - verified: z.coerce.boolean().optional(), - }) - ), - subkeys: z.array( - z.object({ - id: z.coerce.number().optional(), - primary_key_id: z.coerce.number().optional(), - key_id: z.coerce.string().optional(), - public_key: z.coerce.string().optional(), - emails: z.array(z.object({})).optional(), - subkeys: z.array(z.object({})).optional(), - can_sign: z.coerce.boolean().optional(), - can_encrypt_comms: z.coerce.boolean().optional(), - can_encrypt_storage: z.coerce.boolean().optional(), - can_certify: z.coerce.boolean().optional(), - created_at: z.coerce.string().optional(), - expires_at: z.coerce.string().optional(), - raw_key: z.coerce.string().optional(), - revoked: z.coerce.boolean().optional(), - }) - ), - can_sign: z.coerce.boolean(), - can_encrypt_comms: z.coerce.boolean(), - can_encrypt_storage: z.coerce.boolean(), - can_certify: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - expires_at: z.coerce.string().datetime({ offset: true }), - revoked: z.coerce.boolean(), - raw_key: z.coerce.string(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = usersListGpgKeysForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73126,6 +75503,15 @@ export function bootstrap( subject_id: z.coerce.string().optional(), }) + const usersGetContextForUserResponseValidator = responseValidationFactory( + [ + ["200", s_hovercard], + ["404", s_basic_error], + ["422", s_validation_error], + ], + undefined + ) + router.get( "usersGetContextForUser", "/users/:username/hovercard", @@ -73144,14 +75530,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - ["200", s_hovercard], - ["404", s_basic_error], - ["422", s_validation_error], - ], - undefined - )(status, body) + ctx.body = usersGetContextForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73161,6 +75540,11 @@ export function bootstrap( username: z.coerce.string(), }) + const appsGetUserInstallationResponseValidator = responseValidationFactory( + [["200", s_installation]], + undefined + ) + router.get( "appsGetUserInstallation", "/users/:username/installation", @@ -73179,10 +75563,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [["200", s_installation]], - undefined - )(status, body) + ctx.body = appsGetUserInstallationResponseValidator(status, body) ctx.status = status return next() } @@ -73197,6 +75578,16 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListPublicKeysForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array(z.object({ id: z.coerce.number(), key: z.coerce.string() })), + ], + ], + undefined + ) + router.get( "usersListPublicKeysForUser", "/users/:username/keys", @@ -73218,17 +75609,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ id: z.coerce.number(), key: z.coerce.string() }) - ), - ], - ], - undefined - )(status, body) + ctx.body = usersListPublicKeysForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73241,6 +75622,31 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const orgsListForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + hooks_url: z.coerce.string(), + issues_url: z.coerce.string(), + members_url: z.coerce.string(), + public_members_url: z.coerce.string(), + avatar_url: z.coerce.string(), + description: z.coerce.string(), + }) + ), + ], + ], + undefined + ) + router.get("orgsListForUser", "/users/:username/orgs", async (ctx, next) => { const input = { params: parseRequestInput(orgsListForUserParamSchema, ctx.params), @@ -73250,49 +75656,247 @@ export function bootstrap( const { status, body } = await implementation.orgsListForUser(input, ctx) - ctx.body = responseValidationFactory( + ctx.body = orgsListForUserResponseValidator(status, body) + ctx.status = status + return next() + }) + + const packagesListPackagesForUserParamSchema = z.object({ + username: z.coerce.string(), + }) + + const packagesListPackagesForUserQuerySchema = z.object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + visibility: z.enum(["public", "private", "internal"]).optional(), + }) + + const packagesListPackagesForUserResponseValidator = + responseValidationFactory( [ [ "200", z.array( z.object({ - login: z.coerce.string(), id: z.coerce.number(), - node_id: z.coerce.string(), + name: z.coerce.string(), + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - hooks_url: z.coerce.string(), - issues_url: z.coerce.string(), - members_url: z.coerce.string(), - public_members_url: z.coerce.string(), - avatar_url: z.coerce.string(), - description: z.coerce.string(), + html_url: z.coerce.string(), + version_count: z.coerce.number(), + visibility: z.enum(["private", "public"]), + owner: z + .object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + .optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + .optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), }) ), ], + ["401", s_basic_error], + ["403", s_basic_error], ], undefined - )(status, body) - ctx.status = status - return next() - }) - - const packagesListPackagesForUserParamSchema = z.object({ - username: z.coerce.string(), - }) - - const packagesListPackagesForUserQuerySchema = z.object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - visibility: z.enum(["public", "private", "internal"]).optional(), - }) + ) router.get( "packagesListPackagesForUser", @@ -73315,225 +75919,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - url: z.coerce.string(), - html_url: z.coerce.string(), - version_count: z.coerce.number(), - visibility: z.enum(["private", "public"]), - owner: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - .optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesListPackagesForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73552,6 +75938,11 @@ export function bootstrap( username: z.coerce.string(), }) + const packagesGetPackageForUserResponseValidator = responseValidationFactory( + [["200", s_package]], + undefined + ) + router.get( "packagesGetPackageForUser", "/users/:username/packages/:packageType/:packageName", @@ -73570,10 +75961,7 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory([["200", s_package]], undefined)( - status, - body - ) + ctx.body = packagesGetPackageForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73592,6 +75980,17 @@ export function bootstrap( username: z.coerce.string(), }) + const packagesDeletePackageForUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "packagesDeletePackageForUser", "/users/:username/packages/:packageType/:packageName", @@ -73608,15 +76007,7 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesDeletePackageForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73639,6 +76030,17 @@ export function bootstrap( token: z.coerce.string().optional(), }) + const packagesRestorePackageForUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "packagesRestorePackageForUser", "/users/:username/packages/:packageType/:packageName/restore", @@ -73658,15 +76060,7 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesRestorePackageForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73686,6 +76080,54 @@ export function bootstrap( username: z.coerce.string(), }) + const packagesGetAllPackageVersionsForPackageOwnedByUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + package_html_url: z.coerce.string(), + html_url: z.coerce.string().optional(), + license: z.coerce.string().optional(), + description: z.coerce.string().optional(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + deleted_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + metadata: z + .object({ + package_type: z.enum([ + "npm", + "maven", + "rubygems", + "docker", + "nuget", + "container", + ]), + container: z + .object({ tags: z.array(z.coerce.string()) }) + .optional(), + docker: z + .object({ tag: z.array(z.coerce.string()).optional() }) + .optional(), + }) + .optional(), + }) + ), + ], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.get( "packagesGetAllPackageVersionsForPackageOwnedByUser", "/users/:username/packages/:packageType/:packageName/versions", @@ -73705,52 +76147,11 @@ export function bootstrap( ctx ) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - package_html_url: z.coerce.string(), - html_url: z.coerce.string().optional(), - license: z.coerce.string().optional(), - description: z.coerce.string().optional(), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - deleted_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - metadata: z - .object({ - package_type: z.enum([ - "npm", - "maven", - "rubygems", - "docker", - "nuget", - "container", - ]), - container: z - .object({ tags: z.array(z.coerce.string()) }) - .optional(), - docker: z - .object({ tag: z.array(z.coerce.string()).optional() }) - .optional(), - }) - .optional(), - }) - ), - ], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = + packagesGetAllPackageVersionsForPackageOwnedByUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -73770,6 +76171,9 @@ export function bootstrap( username: z.coerce.string(), }) + const packagesGetPackageVersionForUserResponseValidator = + responseValidationFactory([["200", s_package_version]], undefined) + router.get( "packagesGetPackageVersionForUser", "/users/:username/packages/:packageType/:packageName/versions/:packageVersionId", @@ -73786,10 +76190,7 @@ export function bootstrap( const { status, body } = await implementation.packagesGetPackageVersionForUser(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_package_version]], - undefined - )(status, body) + ctx.body = packagesGetPackageVersionForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73809,6 +76210,17 @@ export function bootstrap( package_version_id: z.coerce.number(), }) + const packagesDeletePackageVersionForUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.delete( "packagesDeletePackageVersionForUser", "/users/:username/packages/:packageType/:packageName/versions/:packageVersionId", @@ -73825,15 +76237,10 @@ export function bootstrap( const { status, body } = await implementation.packagesDeletePackageVersionForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesDeletePackageVersionForUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -73853,6 +76260,17 @@ export function bootstrap( package_version_id: z.coerce.number(), }) + const packagesRestorePackageVersionForUserResponseValidator = + responseValidationFactory( + [ + ["204", z.void()], + ["401", s_basic_error], + ["403", s_basic_error], + ["404", s_basic_error], + ], + undefined + ) + router.post( "packagesRestorePackageVersionForUser", "/users/:username/packages/:packageType/:packageName/versions/:packageVersionId/restore", @@ -73869,15 +76287,10 @@ export function bootstrap( const { status, body } = await implementation.packagesRestorePackageVersionForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["401", s_basic_error], - ["403", s_basic_error], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = packagesRestorePackageVersionForUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -73893,73 +76306,75 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "projectsListForUser", - "/users/:username/projects", - async (ctx, next) => { - const input = { - params: parseRequestInput(projectsListForUserParamSchema, ctx.params), - query: parseRequestInput(projectsListForUserQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.projectsListForUser( - input, - ctx - ) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - owner_url: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - columns_url: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - body: z.coerce.string(), - number: z.coerce.number(), - state: z.coerce.string(), - creator: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - organization_permission: z - .enum(["read", "write", "admin", "none"]) - .optional(), - private: z.coerce.boolean().optional(), - }) - ), - ], - ["422", s_validation_error], - ], - undefined - )(status, body) + const projectsListForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + owner_url: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + columns_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + body: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + creator: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + organization_permission: z + .enum(["read", "write", "admin", "none"]) + .optional(), + private: z.coerce.boolean().optional(), + }) + ), + ], + ["422", s_validation_error], + ], + undefined + ) + + router.get( + "projectsListForUser", + "/users/:username/projects", + async (ctx, next) => { + const input = { + params: parseRequestInput(projectsListForUserParamSchema, ctx.params), + query: parseRequestInput(projectsListForUserQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.projectsListForUser( + input, + ctx + ) + + ctx.body = projectsListForUserResponseValidator(status, body) ctx.status = status return next() } @@ -73974,76 +76389,155 @@ export function bootstrap( page: z.coerce.number().optional(), }) - router.get( - "activityListReceivedEventsForUser", - "/users/:username/received_events", - async (ctx, next) => { - const input = { - params: parseRequestInput( - activityListReceivedEventsForUserParamSchema, - ctx.params - ), - query: parseRequestInput( - activityListReceivedEventsForUserQuerySchema, - ctx.query - ), - body: undefined, - } - - const { status, body } = - await implementation.activityListReceivedEventsForUser(input, ctx) - - ctx.body = responseValidationFactory( + const activityListReceivedEventsForUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74066,21 +76560,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74102,10 +76609,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74128,19 +76652,287 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74163,38 +76955,108 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74216,632 +77078,256 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + .optional(), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const activityListReceivedPublicEventsForUserParamSchema = z.object({ - username: z.coerce.string(), - }) - - const activityListReceivedPublicEventsForUserQuerySchema = z.object({ - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ], + undefined + ) router.get( - "activityListReceivedPublicEventsForUser", - "/users/:username/received_events/public", + "activityListReceivedEventsForUser", + "/users/:username/received_events", async (ctx, next) => { const input = { params: parseRequestInput( - activityListReceivedPublicEventsForUserParamSchema, + activityListReceivedEventsForUserParamSchema, ctx.params ), query: parseRequestInput( - activityListReceivedPublicEventsForUserQuerySchema, + activityListReceivedEventsForUserQuerySchema, ctx.query ), body: undefined, } const { status, body } = - await implementation.activityListReceivedPublicEventsForUser(input, ctx) + await implementation.activityListReceivedEventsForUser(input, ctx) + + ctx.body = activityListReceivedEventsForUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const activityListReceivedPublicEventsForUserParamSchema = z.object({ + username: z.coerce.string(), + }) + + const activityListReceivedPublicEventsForUserQuerySchema = z.object({ + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) - ctx.body = responseValidationFactory( + const activityListReceivedPublicEventsForUserResponseValidator = + responseValidationFactory( + [ [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - type: z.coerce.string(), - actor: z.object({ + "200", + z.array( + z.object({ + id: z.coerce.string(), + type: z.coerce.string(), + actor: z.object({ + id: z.coerce.number(), + login: z.coerce.string(), + display_login: z.coerce.string().optional(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + avatar_url: z.coerce.string(), + }), + repo: z.object({ + id: z.coerce.number(), + name: z.coerce.string(), + url: z.coerce.string(), + }), + org: z + .object({ id: z.coerce.number(), login: z.coerce.string(), display_login: z.coerce.string().optional(), gravatar_id: z.coerce.string(), url: z.coerce.string(), avatar_url: z.coerce.string(), - }), - repo: z.object({ - id: z.coerce.number(), - name: z.coerce.string(), - url: z.coerce.string(), - }), - org: z + }) + .optional(), + payload: z.object({ + action: z.coerce.string().optional(), + issue: z .object({ id: z.coerce.number(), - login: z.coerce.string(), - display_login: z.coerce.string().optional(), - gravatar_id: z.coerce.string(), + node_id: z.coerce.string(), url: z.coerce.string(), - avatar_url: z.coerce.string(), - }) - .optional(), - payload: z.object({ - action: z.coerce.string().optional(), - issue: z - .object({ + repository_url: z.coerce.string(), + labels_url: z.coerce.string(), + comments_url: z.coerce.string(), + events_url: z.coerce.string(), + html_url: z.coerce.string(), + number: z.coerce.number(), + state: z.coerce.string(), + state_reason: z + .enum(["completed", "reopened", "not_planned"]) + .optional(), + title: z.coerce.string(), + body: z.coerce.string().optional(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), id: z.coerce.number(), node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), url: z.coerce.string(), - repository_url: z.coerce.string(), - labels_url: z.coerce.string(), - comments_url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + labels: z.array( + z.union([ + z.coerce.string(), + z.object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + name: z.coerce.string().optional(), + description: z.coerce.string().optional(), + color: z.coerce.string().optional(), + default: z.coerce.boolean().optional(), + }), + ]) + ), + assignee: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + assignees: z + .array( + z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }) + ) + .optional(), + milestone: z.object({ + url: z.coerce.string(), html_url: z.coerce.string(), + labels_url: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), number: z.coerce.number(), - state: z.coerce.string(), - state_reason: z - .enum(["completed", "reopened", "not_planned"]) - .optional(), + state: z.enum(["open", "closed"]), title: z.coerce.string(), - body: z.coerce.string().optional(), - user: z.object({ + description: z.coerce.string(), + creator: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74864,21 +77350,34 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - labels: z.array( - z.union([ - z.coerce.string(), - z.object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - name: z.coerce.string().optional(), - description: z.coerce.string().optional(), - color: z.coerce.string().optional(), - default: z.coerce.boolean().optional(), - }), - ]) - ), - assignee: z.object({ + open_issues: z.coerce.number(), + closed_issues: z.coerce.number(), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + closed_at: z.coerce.string().datetime({ offset: true }), + due_on: z.coerce.string().datetime({ offset: true }), + }), + locked: z.coerce.boolean(), + active_lock_reason: z.coerce.string().optional(), + comments: z.coerce.number(), + pull_request: z + .object({ + merged_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + diff_url: z.coerce.string(), + html_url: z.coerce.string(), + patch_url: z.coerce.string(), + url: z.coerce.string(), + }) + .optional(), + closed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + draft: z.coerce.boolean().optional(), + closed_by: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74900,10 +77399,27 @@ export function bootstrap( type: z.coerce.string(), site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), - }), - assignees: z - .array( - z.object({ + }) + .optional(), + body_html: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + timeline_url: z.coerce.string().optional(), + repository: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + license: z.object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + spdx_id: z.coerce.string(), + node_id: z.coerce.string(), + html_url: z.coerce.string().optional(), + }), + organization: z + .object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74926,19 +77442,411 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }) - ) - .optional(), - milestone: z.object({ - url: z.coerce.string(), + .optional(), + forks: z.coerce.number(), + permissions: z + .object({ + admin: z.coerce.boolean(), + pull: z.coerce.boolean(), + triage: z.coerce.boolean().optional(), + push: z.coerce.boolean(), + maintain: z.coerce.boolean().optional(), + }) + .optional(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string(), + mirror_url: z.coerce.string(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string(), + homepage: z.coerce.string(), + language: z.coerce.string(), + forks_count: z.coerce.number(), + stargazers_count: z.coerce.number(), + watchers_count: z.coerce.number(), + size: z.coerce.number(), + default_branch: z.coerce.string(), + open_issues_count: z.coerce.number(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean(), + has_projects: z.coerce.boolean(), + has_wiki: z.coerce.boolean(), + has_pages: z.coerce.boolean(), + has_downloads: z.coerce.boolean(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean(), + disabled: z.coerce.boolean(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + allow_rebase_merge: z.coerce.boolean().optional(), + template_repository: z + .object({ + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + name: z.coerce.string().optional(), + full_name: z.coerce.string().optional(), + owner: z + .object({ + login: z.coerce.string().optional(), + id: z.coerce.number().optional(), + node_id: z.coerce.string().optional(), + avatar_url: z.coerce.string().optional(), + gravatar_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + followers_url: z.coerce.string().optional(), + following_url: z.coerce.string().optional(), + gists_url: z.coerce.string().optional(), + starred_url: z.coerce.string().optional(), + subscriptions_url: z.coerce.string().optional(), + organizations_url: z.coerce.string().optional(), + repos_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + received_events_url: z.coerce + .string() + .optional(), + type: z.coerce.string().optional(), + site_admin: z.coerce.boolean().optional(), + }) + .optional(), + private: z.coerce.boolean().optional(), + html_url: z.coerce.string().optional(), + description: z.coerce.string().optional(), + fork: z.coerce.boolean().optional(), + url: z.coerce.string().optional(), + archive_url: z.coerce.string().optional(), + assignees_url: z.coerce.string().optional(), + blobs_url: z.coerce.string().optional(), + branches_url: z.coerce.string().optional(), + collaborators_url: z.coerce.string().optional(), + comments_url: z.coerce.string().optional(), + commits_url: z.coerce.string().optional(), + compare_url: z.coerce.string().optional(), + contents_url: z.coerce.string().optional(), + contributors_url: z.coerce.string().optional(), + deployments_url: z.coerce.string().optional(), + downloads_url: z.coerce.string().optional(), + events_url: z.coerce.string().optional(), + forks_url: z.coerce.string().optional(), + git_commits_url: z.coerce.string().optional(), + git_refs_url: z.coerce.string().optional(), + git_tags_url: z.coerce.string().optional(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string().optional(), + issue_events_url: z.coerce.string().optional(), + issues_url: z.coerce.string().optional(), + keys_url: z.coerce.string().optional(), + labels_url: z.coerce.string().optional(), + languages_url: z.coerce.string().optional(), + merges_url: z.coerce.string().optional(), + milestones_url: z.coerce.string().optional(), + notifications_url: z.coerce.string().optional(), + pulls_url: z.coerce.string().optional(), + releases_url: z.coerce.string().optional(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string().optional(), + statuses_url: z.coerce.string().optional(), + subscribers_url: z.coerce.string().optional(), + subscription_url: z.coerce.string().optional(), + tags_url: z.coerce.string().optional(), + teams_url: z.coerce.string().optional(), + trees_url: z.coerce.string().optional(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string().optional(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().optional(), + created_at: z.coerce.string().optional(), + updated_at: z.coerce.string().optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + allow_rebase_merge: z.coerce.boolean().optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce + .boolean() + .optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + }) + .optional(), + temp_clone_token: z.coerce.string().optional(), + allow_squash_merge: z.coerce.boolean().optional(), + allow_auto_merge: z.coerce.boolean().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + allow_update_branch: z.coerce.boolean().optional(), + use_squash_pr_title_as_default: z.coerce + .boolean() + .optional(), + squash_merge_commit_title: z + .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) + .optional(), + squash_merge_commit_message: z + .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) + .optional(), + merge_commit_title: z + .enum(["PR_TITLE", "MERGE_MESSAGE"]) + .optional(), + merge_commit_message: z + .enum(["PR_BODY", "PR_TITLE", "BLANK"]) + .optional(), + allow_merge_commit: z.coerce.boolean().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce + .boolean() + .optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + open_issues: z.coerce.number(), + watchers: z.coerce.number(), + master_branch: z.coerce.string().optional(), + starred_at: z.coerce.string().optional(), + anonymous_access_enabled: z.coerce.boolean().optional(), + }) + .optional(), + performed_via_github_app: z + .object({ + id: z.coerce.number(), + slug: z.coerce.string().optional(), + node_id: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), + created_at: z.coerce + .string() + .datetime({ offset: true }), + updated_at: z.coerce + .string() + .datetime({ offset: true }), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + reactions: z + .object({ + url: z.coerce.string(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), + }) + .optional(), + }) + .optional(), + comment: z + .object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + body_text: z.coerce.string().optional(), + body_html: z.coerce.string().optional(), + html_url: z.coerce.string(), + user: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + created_at: z.coerce.string().datetime({ offset: true }), + updated_at: z.coerce.string().datetime({ offset: true }), + issue_url: z.coerce.string(), + author_association: z.enum([ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER", + ]), + performed_via_github_app: z + .object({ id: z.coerce.number(), + slug: z.coerce.string().optional(), node_id: z.coerce.string(), - number: z.coerce.number(), - state: z.enum(["open", "closed"]), - title: z.coerce.string(), - description: z.coerce.string(), - creator: z.object({ + owner: z.object({ name: z.coerce.string().optional(), email: z.coerce.string().optional(), login: z.coerce.string(), @@ -74961,800 +77869,284 @@ export function bootstrap( site_admin: z.coerce.boolean(), starred_at: z.coerce.string().optional(), }), - open_issues: z.coerce.number(), - closed_issues: z.coerce.number(), + name: z.coerce.string(), + description: z.coerce.string(), + external_url: z.coerce.string(), + html_url: z.coerce.string(), created_at: z.coerce .string() .datetime({ offset: true }), updated_at: z.coerce .string() .datetime({ offset: true }), - closed_at: z.coerce.string().datetime({ offset: true }), - due_on: z.coerce.string().datetime({ offset: true }), - }), - locked: z.coerce.boolean(), - active_lock_reason: z.coerce.string().optional(), - comments: z.coerce.number(), - pull_request: z - .object({ - merged_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - diff_url: z.coerce.string(), - html_url: z.coerce.string(), - patch_url: z.coerce.string(), - url: z.coerce.string(), - }) - .optional(), - closed_at: z.coerce.string().datetime({ offset: true }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - draft: z.coerce.boolean().optional(), - closed_by: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - body_html: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - timeline_url: z.coerce.string().optional(), - repository: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - license: z.object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - spdx_id: z.coerce.string(), - node_id: z.coerce.string(), - html_url: z.coerce.string().optional(), - }), - organization: z - .object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number(), - permissions: z - .object({ - admin: z.coerce.boolean(), - pull: z.coerce.boolean(), - triage: z.coerce.boolean().optional(), - push: z.coerce.boolean(), - maintain: z.coerce.boolean().optional(), - }) - .optional(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string(), - mirror_url: z.coerce.string(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string(), - homepage: z.coerce.string(), - language: z.coerce.string(), - forks_count: z.coerce.number(), - stargazers_count: z.coerce.number(), - watchers_count: z.coerce.number(), - size: z.coerce.number(), - default_branch: z.coerce.string(), - open_issues_count: z.coerce.number(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean(), - has_projects: z.coerce.boolean(), - has_wiki: z.coerce.boolean(), - has_pages: z.coerce.boolean(), - has_downloads: z.coerce.boolean(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean(), - disabled: z.coerce.boolean(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - allow_rebase_merge: z.coerce.boolean().optional(), - template_repository: z - .object({ - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - name: z.coerce.string().optional(), - full_name: z.coerce.string().optional(), - owner: z - .object({ - login: z.coerce.string().optional(), - id: z.coerce.number().optional(), - node_id: z.coerce.string().optional(), - avatar_url: z.coerce.string().optional(), - gravatar_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), - followers_url: z.coerce.string().optional(), - following_url: z.coerce.string().optional(), - gists_url: z.coerce.string().optional(), - starred_url: z.coerce.string().optional(), - subscriptions_url: z.coerce - .string() - .optional(), - organizations_url: z.coerce - .string() - .optional(), - repos_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - received_events_url: z.coerce - .string() - .optional(), - type: z.coerce.string().optional(), - site_admin: z.coerce.boolean().optional(), - }) - .optional(), - private: z.coerce.boolean().optional(), - html_url: z.coerce.string().optional(), - description: z.coerce.string().optional(), - fork: z.coerce.boolean().optional(), - url: z.coerce.string().optional(), - archive_url: z.coerce.string().optional(), - assignees_url: z.coerce.string().optional(), - blobs_url: z.coerce.string().optional(), - branches_url: z.coerce.string().optional(), - collaborators_url: z.coerce.string().optional(), - comments_url: z.coerce.string().optional(), - commits_url: z.coerce.string().optional(), - compare_url: z.coerce.string().optional(), - contents_url: z.coerce.string().optional(), - contributors_url: z.coerce.string().optional(), - deployments_url: z.coerce.string().optional(), - downloads_url: z.coerce.string().optional(), - events_url: z.coerce.string().optional(), - forks_url: z.coerce.string().optional(), - git_commits_url: z.coerce.string().optional(), - git_refs_url: z.coerce.string().optional(), - git_tags_url: z.coerce.string().optional(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string().optional(), - issue_events_url: z.coerce.string().optional(), - issues_url: z.coerce.string().optional(), - keys_url: z.coerce.string().optional(), - labels_url: z.coerce.string().optional(), - languages_url: z.coerce.string().optional(), - merges_url: z.coerce.string().optional(), - milestones_url: z.coerce.string().optional(), - notifications_url: z.coerce.string().optional(), - pulls_url: z.coerce.string().optional(), - releases_url: z.coerce.string().optional(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string().optional(), - statuses_url: z.coerce.string().optional(), - subscribers_url: z.coerce.string().optional(), - subscription_url: z.coerce.string().optional(), - tags_url: z.coerce.string().optional(), - teams_url: z.coerce.string().optional(), - trees_url: z.coerce.string().optional(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string().optional(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce.string().optional(), - created_at: z.coerce.string().optional(), - updated_at: z.coerce.string().optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - allow_rebase_merge: z.coerce.boolean().optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce - .boolean() - .optional(), - allow_update_branch: z.coerce - .boolean() - .optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - }) - .optional(), - temp_clone_token: z.coerce.string().optional(), - allow_squash_merge: z.coerce.boolean().optional(), - allow_auto_merge: z.coerce.boolean().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - allow_update_branch: z.coerce.boolean().optional(), - use_squash_pr_title_as_default: z.coerce - .boolean() - .optional(), - squash_merge_commit_title: z - .enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]) - .optional(), - squash_merge_commit_message: z - .enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]) - .optional(), - merge_commit_title: z - .enum(["PR_TITLE", "MERGE_MESSAGE"]) - .optional(), - merge_commit_message: z - .enum(["PR_BODY", "PR_TITLE", "BLANK"]) - .optional(), - allow_merge_commit: z.coerce.boolean().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce - .boolean() - .optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - open_issues: z.coerce.number(), - watchers: z.coerce.number(), - master_branch: z.coerce.string().optional(), - starred_at: z.coerce.string().optional(), - anonymous_access_enabled: z.coerce - .boolean() - .optional(), - }) - .optional(), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - comment: z - .object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - body_text: z.coerce.string().optional(), - body_html: z.coerce.string().optional(), - html_url: z.coerce.string(), - user: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), + permissions: z.object({ + issues: z.coerce.string().optional(), + checks: z.coerce.string().optional(), + metadata: z.coerce.string().optional(), + contents: z.coerce.string().optional(), + deployments: z.coerce.string().optional(), + }), + events: z.array(z.coerce.string()), + installations_count: z.coerce.number().optional(), + client_id: z.coerce.string().optional(), + client_secret: z.coerce.string().optional(), + webhook_secret: z.coerce.string().optional(), + pem: z.coerce.string().optional(), + }) + .optional(), + reactions: z + .object({ url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - created_at: z.coerce.string().datetime({ offset: true }), - updated_at: z.coerce.string().datetime({ offset: true }), - issue_url: z.coerce.string(), - author_association: z.enum([ - "COLLABORATOR", - "CONTRIBUTOR", - "FIRST_TIMER", - "FIRST_TIME_CONTRIBUTOR", - "MANNEQUIN", - "MEMBER", - "NONE", - "OWNER", - ]), - performed_via_github_app: z - .object({ - id: z.coerce.number(), - slug: z.coerce.string().optional(), - node_id: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - name: z.coerce.string(), - description: z.coerce.string(), - external_url: z.coerce.string(), - html_url: z.coerce.string(), - created_at: z.coerce - .string() - .datetime({ offset: true }), - updated_at: z.coerce - .string() - .datetime({ offset: true }), - permissions: z.object({ - issues: z.coerce.string().optional(), - checks: z.coerce.string().optional(), - metadata: z.coerce.string().optional(), - contents: z.coerce.string().optional(), - deployments: z.coerce.string().optional(), - }), - events: z.array(z.coerce.string()), - installations_count: z.coerce.number().optional(), - client_id: z.coerce.string().optional(), - client_secret: z.coerce.string().optional(), - webhook_secret: z.coerce.string().optional(), - pem: z.coerce.string().optional(), - }) - .optional(), - reactions: z - .object({ - url: z.coerce.string(), - total_count: z.coerce.number(), - "+1": z.coerce.number(), - "-1": z.coerce.number(), - laugh: z.coerce.number(), - confused: z.coerce.number(), - heart: z.coerce.number(), - hooray: z.coerce.number(), - eyes: z.coerce.number(), - rocket: z.coerce.number(), - }) - .optional(), - }) - .optional(), - pages: z - .array( - z.object({ - page_name: z.coerce.string().optional(), - title: z.coerce.string().optional(), - summary: z.coerce.string().optional(), - action: z.coerce.string().optional(), - sha: z.coerce.string().optional(), - html_url: z.coerce.string().optional(), + total_count: z.coerce.number(), + "+1": z.coerce.number(), + "-1": z.coerce.number(), + laugh: z.coerce.number(), + confused: z.coerce.number(), + heart: z.coerce.number(), + hooray: z.coerce.number(), + eyes: z.coerce.number(), + rocket: z.coerce.number(), }) - ) - .optional(), - }), - public: z.coerce.boolean(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], + .optional(), + }) + .optional(), + pages: z + .array( + z.object({ + page_name: z.coerce.string().optional(), + title: z.coerce.string().optional(), + summary: z.coerce.string().optional(), + action: z.coerce.string().optional(), + sha: z.coerce.string().optional(), + html_url: z.coerce.string().optional(), + }) + ) + .optional(), + }), + public: z.coerce.boolean(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), ], - undefined - )(status, body) - ctx.status = status - return next() - } - ) - - const reposListForUserParamSchema = z.object({ username: z.coerce.string() }) - - const reposListForUserQuerySchema = z.object({ - type: z.enum(["all", "owner", "member"]).optional(), - sort: z.enum(["created", "updated", "pushed", "full_name"]).optional(), - direction: z.enum(["asc", "desc"]).optional(), - per_page: z.coerce.number().optional(), - page: z.coerce.number().optional(), - }) + ], + undefined + ) router.get( - "reposListForUser", - "/users/:username/repos", + "activityListReceivedPublicEventsForUser", + "/users/:username/received_events/public", async (ctx, next) => { const input = { - params: parseRequestInput(reposListForUserParamSchema, ctx.params), - query: parseRequestInput(reposListForUserQuerySchema, ctx.query), - body: undefined, - } - - const { status, body } = await implementation.reposListForUser(input, ctx) - - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z + params: parseRequestInput( + activityListReceivedPublicEventsForUserParamSchema, + ctx.params + ), + query: parseRequestInput( + activityListReceivedPublicEventsForUserQuerySchema, + ctx.query + ), + body: undefined, + } + + const { status, body } = + await implementation.activityListReceivedPublicEventsForUser(input, ctx) + + ctx.body = activityListReceivedPublicEventsForUserResponseValidator( + status, + body + ) + ctx.status = status + return next() + } + ) + + const reposListForUserParamSchema = z.object({ username: z.coerce.string() }) + + const reposListForUserQuerySchema = z.object({ + type: z.enum(["all", "owner", "member"]).optional(), + sort: z.enum(["created", "updated", "pushed", "full_name"]).optional(), + direction: z.enum(["asc", "desc"]).optional(), + per_page: z.coerce.number().optional(), + page: z.coerce.number().optional(), + }) + + const reposListForUserResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce.string().datetime({ offset: true }).optional(), + created_at: z.coerce.string().datetime({ offset: true }).optional(), + updated_at: z.coerce.string().datetime({ offset: true }).optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - license: z + secret_scanning: z .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z + secret_scanning_push_protection: z .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), + status: z.enum(["enabled", "disabled"]).optional(), }) .optional(), }) - ), - ], - ], - undefined - )(status, body) + .optional(), + }) + ), + ], + ], + undefined + ) + + router.get( + "reposListForUser", + "/users/:username/repos", + async (ctx, next) => { + const input = { + params: parseRequestInput(reposListForUserParamSchema, ctx.params), + query: parseRequestInput(reposListForUserQuerySchema, ctx.query), + body: undefined, + } + + const { status, body } = await implementation.reposListForUser(input, ctx) + + ctx.body = reposListForUserResponseValidator(status, body) ctx.status = status return next() } @@ -75764,6 +78156,9 @@ export function bootstrap( username: z.coerce.string(), }) + const billingGetGithubActionsBillingUserResponseValidator = + responseValidationFactory([["200", s_actions_billing_usage]], undefined) + router.get( "billingGetGithubActionsBillingUser", "/users/:username/settings/billing/actions", @@ -75780,10 +78175,10 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubActionsBillingUser(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_actions_billing_usage]], - undefined - )(status, body) + ctx.body = billingGetGithubActionsBillingUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -75793,6 +78188,9 @@ export function bootstrap( username: z.coerce.string(), }) + const billingGetGithubPackagesBillingUserResponseValidator = + responseValidationFactory([["200", s_packages_billing_usage]], undefined) + router.get( "billingGetGithubPackagesBillingUser", "/users/:username/settings/billing/packages", @@ -75809,10 +78207,10 @@ export function bootstrap( const { status, body } = await implementation.billingGetGithubPackagesBillingUser(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_packages_billing_usage]], - undefined - )(status, body) + ctx.body = billingGetGithubPackagesBillingUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -75822,6 +78220,9 @@ export function bootstrap( username: z.coerce.string(), }) + const billingGetSharedStorageBillingUserResponseValidator = + responseValidationFactory([["200", s_combined_billing_usage]], undefined) + router.get( "billingGetSharedStorageBillingUser", "/users/:username/settings/billing/shared-storage", @@ -75838,10 +78239,10 @@ export function bootstrap( const { status, body } = await implementation.billingGetSharedStorageBillingUser(input, ctx) - ctx.body = responseValidationFactory( - [["200", s_combined_billing_usage]], - undefined - )(status, body) + ctx.body = billingGetSharedStorageBillingUserResponseValidator( + status, + body + ) ctx.status = status return next() } @@ -75856,6 +78257,24 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const usersListSshSigningKeysForUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + key: z.coerce.string(), + id: z.coerce.number(), + title: z.coerce.string(), + created_at: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + router.get( "usersListSshSigningKeysForUser", "/users/:username/ssh_signing_keys", @@ -75875,22 +78294,7 @@ export function bootstrap( const { status, body } = await implementation.usersListSshSigningKeysForUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - key: z.coerce.string(), - id: z.coerce.number(), - title: z.coerce.string(), - created_at: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = usersListSshSigningKeysForUserResponseValidator(status, body) ctx.status = status return next() } @@ -75907,6 +78311,9 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const activityListReposStarredByUserResponseValidator = + responseValidationFactory([["200", z.object({})]], undefined) + router.get( "activityListReposStarredByUser", "/users/:username/starred", @@ -75926,10 +78333,7 @@ export function bootstrap( const { status, body } = await implementation.activityListReposStarredByUser(input, ctx) - ctx.body = responseValidationFactory([["200", z.object({})]], undefined)( - status, - body - ) + ctx.body = activityListReposStarredByUserResponseValidator(status, body) ctx.status = status return next() } @@ -75944,6 +78348,180 @@ export function bootstrap( page: z.coerce.number().optional(), }) + const activityListReposWatchedByUserResponseValidator = + responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.number(), + node_id: z.coerce.string(), + name: z.coerce.string(), + full_name: z.coerce.string(), + owner: z.object({ + name: z.coerce.string().optional(), + email: z.coerce.string().optional(), + login: z.coerce.string(), + id: z.coerce.number(), + node_id: z.coerce.string(), + avatar_url: z.coerce.string(), + gravatar_id: z.coerce.string(), + url: z.coerce.string(), + html_url: z.coerce.string(), + followers_url: z.coerce.string(), + following_url: z.coerce.string(), + gists_url: z.coerce.string(), + starred_url: z.coerce.string(), + subscriptions_url: z.coerce.string(), + organizations_url: z.coerce.string(), + repos_url: z.coerce.string(), + events_url: z.coerce.string(), + received_events_url: z.coerce.string(), + type: z.coerce.string(), + site_admin: z.coerce.boolean(), + starred_at: z.coerce.string().optional(), + }), + private: z.coerce.boolean(), + html_url: z.coerce.string(), + description: z.coerce.string(), + fork: z.coerce.boolean(), + url: z.coerce.string(), + archive_url: z.coerce.string(), + assignees_url: z.coerce.string(), + blobs_url: z.coerce.string(), + branches_url: z.coerce.string(), + collaborators_url: z.coerce.string(), + comments_url: z.coerce.string(), + commits_url: z.coerce.string(), + compare_url: z.coerce.string(), + contents_url: z.coerce.string(), + contributors_url: z.coerce.string(), + deployments_url: z.coerce.string(), + downloads_url: z.coerce.string(), + events_url: z.coerce.string(), + forks_url: z.coerce.string(), + git_commits_url: z.coerce.string(), + git_refs_url: z.coerce.string(), + git_tags_url: z.coerce.string(), + git_url: z.coerce.string().optional(), + issue_comment_url: z.coerce.string(), + issue_events_url: z.coerce.string(), + issues_url: z.coerce.string(), + keys_url: z.coerce.string(), + labels_url: z.coerce.string(), + languages_url: z.coerce.string(), + merges_url: z.coerce.string(), + milestones_url: z.coerce.string(), + notifications_url: z.coerce.string(), + pulls_url: z.coerce.string(), + releases_url: z.coerce.string(), + ssh_url: z.coerce.string().optional(), + stargazers_url: z.coerce.string(), + statuses_url: z.coerce.string(), + subscribers_url: z.coerce.string(), + subscription_url: z.coerce.string(), + tags_url: z.coerce.string(), + teams_url: z.coerce.string(), + trees_url: z.coerce.string(), + clone_url: z.coerce.string().optional(), + mirror_url: z.coerce.string().optional(), + hooks_url: z.coerce.string(), + svn_url: z.coerce.string().optional(), + homepage: z.coerce.string().optional(), + language: z.coerce.string().optional(), + forks_count: z.coerce.number().optional(), + stargazers_count: z.coerce.number().optional(), + watchers_count: z.coerce.number().optional(), + size: z.coerce.number().optional(), + default_branch: z.coerce.string().optional(), + open_issues_count: z.coerce.number().optional(), + is_template: z.coerce.boolean().optional(), + topics: z.array(z.coerce.string()).optional(), + has_issues: z.coerce.boolean().optional(), + has_projects: z.coerce.boolean().optional(), + has_wiki: z.coerce.boolean().optional(), + has_pages: z.coerce.boolean().optional(), + has_downloads: z.coerce.boolean().optional(), + has_discussions: z.coerce.boolean().optional(), + archived: z.coerce.boolean().optional(), + disabled: z.coerce.boolean().optional(), + visibility: z.coerce.string().optional(), + pushed_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + created_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + updated_at: z.coerce + .string() + .datetime({ offset: true }) + .optional(), + permissions: z + .object({ + admin: z.coerce.boolean().optional(), + maintain: z.coerce.boolean().optional(), + push: z.coerce.boolean().optional(), + triage: z.coerce.boolean().optional(), + pull: z.coerce.boolean().optional(), + }) + .optional(), + role_name: z.coerce.string().optional(), + temp_clone_token: z.coerce.string().optional(), + delete_branch_on_merge: z.coerce.boolean().optional(), + subscribers_count: z.coerce.number().optional(), + network_count: z.coerce.number().optional(), + code_of_conduct: z + .object({ + key: z.coerce.string(), + name: z.coerce.string(), + url: z.coerce.string(), + body: z.coerce.string().optional(), + html_url: z.coerce.string(), + }) + .optional(), + license: z + .object({ + key: z.coerce.string().optional(), + name: z.coerce.string().optional(), + spdx_id: z.coerce.string().optional(), + url: z.coerce.string().optional(), + node_id: z.coerce.string().optional(), + }) + .optional(), + forks: z.coerce.number().optional(), + open_issues: z.coerce.number().optional(), + watchers: z.coerce.number().optional(), + allow_forking: z.coerce.boolean().optional(), + web_commit_signoff_required: z.coerce.boolean().optional(), + security_and_analysis: z + .object({ + advanced_security: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + secret_scanning_push_protection: z + .object({ + status: z.enum(["enabled", "disabled"]).optional(), + }) + .optional(), + }) + .optional(), + }) + ), + ], + ], + undefined + ) + router.get( "activityListReposWatchedByUser", "/users/:username/subscriptions", @@ -75963,183 +78541,20 @@ export function bootstrap( const { status, body } = await implementation.activityListReposWatchedByUser(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.number(), - node_id: z.coerce.string(), - name: z.coerce.string(), - full_name: z.coerce.string(), - owner: z.object({ - name: z.coerce.string().optional(), - email: z.coerce.string().optional(), - login: z.coerce.string(), - id: z.coerce.number(), - node_id: z.coerce.string(), - avatar_url: z.coerce.string(), - gravatar_id: z.coerce.string(), - url: z.coerce.string(), - html_url: z.coerce.string(), - followers_url: z.coerce.string(), - following_url: z.coerce.string(), - gists_url: z.coerce.string(), - starred_url: z.coerce.string(), - subscriptions_url: z.coerce.string(), - organizations_url: z.coerce.string(), - repos_url: z.coerce.string(), - events_url: z.coerce.string(), - received_events_url: z.coerce.string(), - type: z.coerce.string(), - site_admin: z.coerce.boolean(), - starred_at: z.coerce.string().optional(), - }), - private: z.coerce.boolean(), - html_url: z.coerce.string(), - description: z.coerce.string(), - fork: z.coerce.boolean(), - url: z.coerce.string(), - archive_url: z.coerce.string(), - assignees_url: z.coerce.string(), - blobs_url: z.coerce.string(), - branches_url: z.coerce.string(), - collaborators_url: z.coerce.string(), - comments_url: z.coerce.string(), - commits_url: z.coerce.string(), - compare_url: z.coerce.string(), - contents_url: z.coerce.string(), - contributors_url: z.coerce.string(), - deployments_url: z.coerce.string(), - downloads_url: z.coerce.string(), - events_url: z.coerce.string(), - forks_url: z.coerce.string(), - git_commits_url: z.coerce.string(), - git_refs_url: z.coerce.string(), - git_tags_url: z.coerce.string(), - git_url: z.coerce.string().optional(), - issue_comment_url: z.coerce.string(), - issue_events_url: z.coerce.string(), - issues_url: z.coerce.string(), - keys_url: z.coerce.string(), - labels_url: z.coerce.string(), - languages_url: z.coerce.string(), - merges_url: z.coerce.string(), - milestones_url: z.coerce.string(), - notifications_url: z.coerce.string(), - pulls_url: z.coerce.string(), - releases_url: z.coerce.string(), - ssh_url: z.coerce.string().optional(), - stargazers_url: z.coerce.string(), - statuses_url: z.coerce.string(), - subscribers_url: z.coerce.string(), - subscription_url: z.coerce.string(), - tags_url: z.coerce.string(), - teams_url: z.coerce.string(), - trees_url: z.coerce.string(), - clone_url: z.coerce.string().optional(), - mirror_url: z.coerce.string().optional(), - hooks_url: z.coerce.string(), - svn_url: z.coerce.string().optional(), - homepage: z.coerce.string().optional(), - language: z.coerce.string().optional(), - forks_count: z.coerce.number().optional(), - stargazers_count: z.coerce.number().optional(), - watchers_count: z.coerce.number().optional(), - size: z.coerce.number().optional(), - default_branch: z.coerce.string().optional(), - open_issues_count: z.coerce.number().optional(), - is_template: z.coerce.boolean().optional(), - topics: z.array(z.coerce.string()).optional(), - has_issues: z.coerce.boolean().optional(), - has_projects: z.coerce.boolean().optional(), - has_wiki: z.coerce.boolean().optional(), - has_pages: z.coerce.boolean().optional(), - has_downloads: z.coerce.boolean().optional(), - has_discussions: z.coerce.boolean().optional(), - archived: z.coerce.boolean().optional(), - disabled: z.coerce.boolean().optional(), - visibility: z.coerce.string().optional(), - pushed_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - created_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - updated_at: z.coerce - .string() - .datetime({ offset: true }) - .optional(), - permissions: z - .object({ - admin: z.coerce.boolean().optional(), - maintain: z.coerce.boolean().optional(), - push: z.coerce.boolean().optional(), - triage: z.coerce.boolean().optional(), - pull: z.coerce.boolean().optional(), - }) - .optional(), - role_name: z.coerce.string().optional(), - temp_clone_token: z.coerce.string().optional(), - delete_branch_on_merge: z.coerce.boolean().optional(), - subscribers_count: z.coerce.number().optional(), - network_count: z.coerce.number().optional(), - code_of_conduct: z - .object({ - key: z.coerce.string(), - name: z.coerce.string(), - url: z.coerce.string(), - body: z.coerce.string().optional(), - html_url: z.coerce.string(), - }) - .optional(), - license: z - .object({ - key: z.coerce.string().optional(), - name: z.coerce.string().optional(), - spdx_id: z.coerce.string().optional(), - url: z.coerce.string().optional(), - node_id: z.coerce.string().optional(), - }) - .optional(), - forks: z.coerce.number().optional(), - open_issues: z.coerce.number().optional(), - watchers: z.coerce.number().optional(), - allow_forking: z.coerce.boolean().optional(), - web_commit_signoff_required: z.coerce.boolean().optional(), - security_and_analysis: z - .object({ - advanced_security: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - secret_scanning_push_protection: z - .object({ - status: z.enum(["enabled", "disabled"]).optional(), - }) - .optional(), - }) - .optional(), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = activityListReposWatchedByUserResponseValidator(status, body) ctx.status = status return next() } ) + const metaGetAllVersionsResponseValidator = responseValidationFactory( + [ + ["200", z.array(z.coerce.string())], + ["404", s_basic_error], + ], + undefined + ) + router.get("metaGetAllVersions", "/versions", async (ctx, next) => { const input = { params: undefined, @@ -76149,17 +78564,16 @@ export function bootstrap( const { status, body } = await implementation.metaGetAllVersions(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", z.array(z.coerce.string())], - ["404", s_basic_error], - ], - undefined - )(status, body) + ctx.body = metaGetAllVersionsResponseValidator(status, body) ctx.status = status return next() }) + const metaGetZenResponseValidator = responseValidationFactory( + [["200", z.coerce.string()]], + undefined + ) + router.get("metaGetZen", "/zen", async (ctx, next) => { const input = { params: undefined, @@ -76169,10 +78583,7 @@ export function bootstrap( const { status, body } = await implementation.metaGetZen(input, ctx) - ctx.body = responseValidationFactory( - [["200", z.coerce.string()]], - undefined - )(status, body) + ctx.body = metaGetZenResponseValidator(status, body) ctx.status = status return next() }) diff --git a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts index 21dfdfe3b..9eadc3944 100644 --- a/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts +++ b/integration-tests/typescript-koa/src/petstore-expanded.yml/generated.ts @@ -73,6 +73,11 @@ export function bootstrap( limit: z.coerce.number().optional(), }) + const findPetsResponseValidator = responseValidationFactory( + [["200", z.array(s_NewPet.merge(z.object({ id: z.coerce.number() })))]], + s_Error + ) + router.get("findPets", "/pets", async (ctx, next) => { const input = { params: undefined, @@ -82,16 +87,18 @@ export function bootstrap( const { status, body } = await implementation.findPets(input, ctx) - ctx.body = responseValidationFactory( - [["200", z.array(s_NewPet.merge(z.object({ id: z.coerce.number() })))]], - s_Error - )(status, body) + ctx.body = findPetsResponseValidator(status, body) ctx.status = status return next() }) const addPetBodySchema = s_NewPet + const addPetResponseValidator = responseValidationFactory( + [["200", s_Pet]], + s_Error + ) + router.post("addPet", "/pets", async (ctx, next) => { const input = { params: undefined, @@ -101,16 +108,18 @@ export function bootstrap( const { status, body } = await implementation.addPet(input, ctx) - ctx.body = responseValidationFactory([["200", s_Pet]], s_Error)( - status, - body - ) + ctx.body = addPetResponseValidator(status, body) ctx.status = status return next() }) const findPetByIdParamSchema = z.object({ id: z.coerce.number() }) + const findPetByIdResponseValidator = responseValidationFactory( + [["200", s_Pet]], + s_Error + ) + router.get("findPetById", "/pets/:id", async (ctx, next) => { const input = { params: parseRequestInput(findPetByIdParamSchema, ctx.params), @@ -120,16 +129,18 @@ export function bootstrap( const { status, body } = await implementation.findPetById(input, ctx) - ctx.body = responseValidationFactory([["200", s_Pet]], s_Error)( - status, - body - ) + ctx.body = findPetByIdResponseValidator(status, body) ctx.status = status return next() }) const deletePetParamSchema = z.object({ id: z.coerce.number() }) + const deletePetResponseValidator = responseValidationFactory( + [["204", z.void()]], + s_Error + ) + router.delete("deletePet", "/pets/:id", async (ctx, next) => { const input = { params: parseRequestInput(deletePetParamSchema, ctx.params), @@ -139,10 +150,7 @@ export function bootstrap( const { status, body } = await implementation.deletePet(input, ctx) - ctx.body = responseValidationFactory([["204", z.void()]], s_Error)( - status, - body - ) + ctx.body = deletePetResponseValidator(status, body) ctx.status = status return next() }) diff --git a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts index e68fe4bff..ad1b45752 100644 --- a/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts +++ b/integration-tests/typescript-koa/src/todo-lists.yml/generated.ts @@ -89,6 +89,25 @@ export function bootstrap( status: z.enum(["incomplete", "complete"]).optional(), }) + const getTodoListsResponseValidator = responseValidationFactory( + [ + [ + "200", + z.array( + z.object({ + id: z.coerce.string(), + name: z.coerce.string(), + totalItemCount: z.coerce.number(), + incompleteItemCount: z.coerce.number(), + created: z.coerce.string().datetime({ offset: true }), + updated: z.coerce.string().datetime({ offset: true }), + }) + ), + ], + ], + undefined + ) + router.get("getTodoLists", "/list", async (ctx, next) => { const input = { params: undefined, @@ -98,30 +117,21 @@ export function bootstrap( const { status, body } = await implementation.getTodoLists(input, ctx) - ctx.body = responseValidationFactory( - [ - [ - "200", - z.array( - z.object({ - id: z.coerce.string(), - name: z.coerce.string(), - totalItemCount: z.coerce.number(), - incompleteItemCount: z.coerce.number(), - created: z.coerce.string().datetime({ offset: true }), - updated: z.coerce.string().datetime({ offset: true }), - }) - ), - ], - ], - undefined - )(status, body) + ctx.body = getTodoListsResponseValidator(status, body) ctx.status = status return next() }) const getTodoListByIdParamSchema = z.object({ listId: z.coerce.string() }) + const getTodoListByIdResponseValidator = responseValidationFactory( + [ + ["200", s_TodoList], + ["4XX", s_Error], + ], + z.void() + ) + router.get("getTodoListById", "/list/:listId", async (ctx, next) => { const input = { params: parseRequestInput(getTodoListByIdParamSchema, ctx.params), @@ -131,13 +141,7 @@ export function bootstrap( const { status, body } = await implementation.getTodoListById(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_TodoList], - ["4XX", s_Error], - ], - z.void() - )(status, body) + ctx.body = getTodoListByIdResponseValidator(status, body) ctx.status = status return next() }) @@ -146,6 +150,14 @@ export function bootstrap( const updateTodoListByIdBodySchema = s_CreateUpdateTodoList + const updateTodoListByIdResponseValidator = responseValidationFactory( + [ + ["200", s_TodoList], + ["4XX", s_Error], + ], + z.void() + ) + router.put("updateTodoListById", "/list/:listId", async (ctx, next) => { const input = { params: parseRequestInput(updateTodoListByIdParamSchema, ctx.params), @@ -155,19 +167,21 @@ export function bootstrap( const { status, body } = await implementation.updateTodoListById(input, ctx) - ctx.body = responseValidationFactory( - [ - ["200", s_TodoList], - ["4XX", s_Error], - ], - z.void() - )(status, body) + ctx.body = updateTodoListByIdResponseValidator(status, body) ctx.status = status return next() }) const deleteTodoListByIdParamSchema = z.object({ listId: z.coerce.string() }) + const deleteTodoListByIdResponseValidator = responseValidationFactory( + [ + ["204", z.void()], + ["4XX", s_Error], + ], + z.void() + ) + router.delete("deleteTodoListById", "/list/:listId", async (ctx, next) => { const input = { params: parseRequestInput(deleteTodoListByIdParamSchema, ctx.params), @@ -177,13 +191,7 @@ export function bootstrap( const { status, body } = await implementation.deleteTodoListById(input, ctx) - ctx.body = responseValidationFactory( - [ - ["204", z.void()], - ["4XX", s_Error], - ], - z.void() - )(status, body) + ctx.body = deleteTodoListByIdResponseValidator(status, body) ctx.status = status return next() }) diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts index 9b349edbe..729a40ed5 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/typescript-koa.generator.ts @@ -1,10 +1,10 @@ import _ from "lodash" -import { Input } from "../../core/input" -import { IRModelObject, IROperation, IRParameter } from "../../core/openapi-types-normalized" -import { ImportBuilder } from "../common/import-builder" -import { emitGenerationResult, loadPreviousResult } from "../common/output-utils" -import { ModelBuilder } from "../common/model-builder" -import { isDefined, titleCase } from "../../core/utils" +import {Input} from "../../core/input" +import {IRModelObject, IROperation, IRParameter} from "../../core/openapi-types-normalized" +import {ImportBuilder} from "../common/import-builder" +import {emitGenerationResult, loadPreviousResult} from "../common/output-utils" +import {ModelBuilder} from "../common/model-builder" +import {isDefined, titleCase} from "../../core/utils" import {SchemaBuilder, schemaBuilderFactory} from "./schema-builders/schema-builder" import {requestBodyAsParameter} from "../common/typescript-common" @@ -73,31 +73,31 @@ export class ServerBuilder { const querySchema = queryParams.length ? schemaBuilder.fromParameters(queryParams) : undefined let queryParamsType = "void" - const { requestBodyParameter } = requestBodyAsParameter(operation) + const {requestBodyParameter} = requestBodyAsParameter(operation) const bodyParamIsRequired = Boolean(requestBodyParameter?.required) const bodyParamSchema = requestBodyParameter ? schemaBuilder.fromModel(requestBodyParameter.schema, requestBodyParameter.required) : undefined let bodyParamsType = "void" if (paramSchema) { - const name = `${ operation.operationId }ParamSchema` - pathParamsType = models.schemaObjectToType({ $ref: this.input.loader.addVirtualType(operation.operationId, _.upperFirst(name), reduceParamsToOpenApiSchema(pathParams)) }) - this.statements.push(`const ${ name } = ${ paramSchema.toString() }`) + const name = `${operation.operationId}ParamSchema` + pathParamsType = models.schemaObjectToType({$ref: this.input.loader.addVirtualType(operation.operationId, _.upperFirst(name), reduceParamsToOpenApiSchema(pathParams))}) + this.statements.push(`const ${name} = ${paramSchema.toString()}`) } if (querySchema) { - const name = `${ operation.operationId }QuerySchema` + const name = `${operation.operationId}QuerySchema` queryParamsType = models.schemaObjectToType({ $ref: this.input.loader.addVirtualType(operation.operationId, _.upperFirst(name), reduceParamsToOpenApiSchema(queryParams)), }) - this.statements.push(`const ${ name } = ${ querySchema.toString() }`) + this.statements.push(`const ${name} = ${querySchema.toString()}`) } if (bodyParamSchema && requestBodyParameter) { - const name = `${ operation.operationId }BodySchema` + const name = `${operation.operationId}BodySchema` bodyParamsType = models.schemaObjectToType({ $ref: this.input.loader.addVirtualType(operation.operationId, _.upperFirst(name), this.input.schema(requestBodyParameter.schema)), }) - this.statements.push(`const ${ name } = ${ bodyParamSchema }`) + this.statements.push(`const ${name} = ${bodyParamSchema}`) } const statusStringToType = (status: string) => { @@ -112,7 +112,7 @@ export class ServerBuilder { const responseSchemas = Object.entries(operation.responses ?? {}).reduce((acc, [status, response]) => { const content = Object.values(response.content ?? {}).pop() - if(status === "default"){ + if (status === "default") { acc.defaultResponse = { schema: content ? schemaBuilder.fromModel(content.schema, true) : schemaBuilder.void(), type: content ? models.schemaObjectToType(content.schema) : "void", @@ -127,36 +127,40 @@ export class ServerBuilder { } return acc - }, {specific: [], defaultResponse: undefined} as {specific: {statusString: string, statusType: string, schema: string, type: string}[], defaultResponse?: { + }, {specific: [], defaultResponse: undefined} as { + specific: { statusString: string, statusType: string, schema: string, type: string }[], defaultResponse?: { type: string, schema: string - }}) + } + }) this.operationTypeMap[operation.operationId] = ` export type ${titleCase(operation.operationId)} = ( - params: Params<${ pathParamsType }, ${ queryParamsType }, ${ bodyParamsType + (bodyParamsType === "void" || bodyParamIsRequired ? "" : " | undefined") }>, + params: Params<${pathParamsType}, ${queryParamsType}, ${bodyParamsType + (bodyParamsType === "void" || bodyParamIsRequired ? "" : " | undefined")}>, ctx: Context ) => Promise< ${[ ...responseSchemas.specific.map(it => `Response<${it.statusType}, ${it.type}>`), responseSchemas.defaultResponse && `Response`, - ].filter(isDefined).join(" | ")} + ].filter(isDefined).join(" | ")} > ` this.statements.push([ - `router.${ operation.method.toLowerCase() }('${ operation.operationId }','${ route(operation.route) }',`, + `const ${operation.operationId}ResponseValidator = responseValidationFactory([${ + responseSchemas.specific.map(it => `["${it.statusString}", ${it.schema}]`)} + ], ${responseSchemas.defaultResponse?.schema})`, + "", + `router.${operation.method.toLowerCase()}('${operation.operationId}','${route(operation.route)}',`, `async (ctx, next) => { const input = { - params: ${paramSchema ? `parseRequestInput(${ operation.operationId }ParamSchema, ctx.params)` : "undefined"}, - query: ${querySchema ? `parseRequestInput(${ operation.operationId }QuerySchema, ctx.query)` : "undefined"}, - body: ${bodyParamSchema ? `parseRequestInput(${ operation.operationId }BodySchema, ctx.body)` : "undefined"}, + params: ${paramSchema ? `parseRequestInput(${operation.operationId}ParamSchema, ctx.params)` : "undefined"}, + query: ${querySchema ? `parseRequestInput(${operation.operationId}QuerySchema, ctx.query)` : "undefined"}, + body: ${bodyParamSchema ? `parseRequestInput(${operation.operationId}BodySchema, ctx.body)` : "undefined"}, } const {status, body} = await implementation.${operation.operationId}(input, ctx) - ctx.body = responseValidationFactory([${ - responseSchemas.specific.map(it => `["${it.statusString}", ${it.schema}]`)} - ], ${responseSchemas.defaultResponse?.schema})(status, body) + ctx.body = ${operation.operationId}ResponseValidator(status, body) ctx.status = status return next(); })`, @@ -169,7 +173,7 @@ export class ServerBuilder { const imports = this.imports return ` -${ imports.toString() } +${imports.toString()} //region safe-edit-region-header //endregion safe-edit-region-header @@ -180,10 +184,10 @@ export type Implementation = { } export function bootstrap(implementation: Implementation, config: Omit){ - // ${ clientName } + // ${clientName} const router = new KoaRouter() - ${ routes.join("\n\n") } + ${routes.join("\n\n")} return startServer({ middleware: [], @@ -204,7 +208,7 @@ function route(route: string): string { }, route) } -export async function generateTypescriptKoa({ dest, input }: { dest: string, input: Input }): Promise { +export async function generateTypescriptKoa({dest, input}: { dest: string, input: Input }): Promise { const imports = new ImportBuilder() const models = ModelBuilder.fromInput("./models.ts", input).withImports(imports) const schemaBuilder = schemaBuilderFactory("zod", input, imports) @@ -216,7 +220,7 @@ export async function generateTypescriptKoa({ dest, input }: { dest: string, inp imports, models, schemaBuilder, - loadExistingImplementations(await loadPreviousResult(dest, { filename: "index.ts" })) + loadExistingImplementations(await loadPreviousResult(dest, {filename: "index.ts"})) ) input.allOperations() From a4bbe78a5466a66ba48dcc4d5dd6e929215e3a12 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 2 Apr 2023 19:43:01 +0100 Subject: [PATCH 10/10] fix: reformat, need to get prettier in --- packages/openapi-code-generator/src/config.ts | 4 +- .../src/core/cli-utils.ts | 4 +- .../src/core/file-loader.ts | 12 +- .../src/core/generation-lib.ts | 8 +- .../openapi-code-generator/src/core/input.ts | 14 +-- .../openapi-code-generator/src/core/logger.ts | 10 +- .../src/core/openapi-loader.ts | 30 ++--- .../src/core/openapi-utils.ts | 6 +- .../src/core/openapi-validator.ts | 12 +- packages/openapi-code-generator/src/index.ts | 14 +-- .../openapi-code-generator/src/templates.ts | 8 +- .../src/test/unit-test-inputs.yaml | 14 +-- .../src/typescript/common/client-builder.ts | 12 +- .../common/client-operation-builder.ts | 34 +++--- .../typescript/common/import-builder.spec.ts | 4 +- .../src/typescript/common/import-builder.ts | 6 +- .../typescript/common/model-builder.spec.ts | 16 +-- .../src/typescript/common/model-builder.ts | 42 +++---- .../src/typescript/common/output-utils.ts | 6 +- .../typescript/common/typescript-common.ts | 37 ++++--- .../angular-module-builder.ts | 14 +-- .../angular-service-builder.ts | 38 +++---- .../typescript-angular.generator.ts | 12 +- .../typescript-fetch-client-builder.ts | 103 +++++++++--------- .../typescript-fetch.generator.ts | 10 +- .../abstract-schema-builder.ts | 6 +- .../schema-builders/joi-schema-builder.ts | 1 + .../zod-schema-builder.spec.ts | 16 +-- packages/openapi-code-generator/tsconfig.json | 6 +- packages/typescript-koa-runtime/src/server.ts | 12 +- packages/typescript-koa-runtime/tsconfig.json | 4 +- 31 files changed, 261 insertions(+), 254 deletions(-) diff --git a/packages/openapi-code-generator/src/config.ts b/packages/openapi-code-generator/src/config.ts index 5c79c2971..1c2ff5fb5 100644 --- a/packages/openapi-code-generator/src/config.ts +++ b/packages/openapi-code-generator/src/config.ts @@ -1,5 +1,5 @@ import convict from "convict" -import { OpenapiGenerator, templates } from "./templates" +import {OpenapiGenerator, templates} from "./templates" const convictConfig = convict({ input: { @@ -38,7 +38,7 @@ export class Config { const template = convictConfig.get("template") if (!Reflect.has(templates, template)) { - throw new Error(`template named '${ template }' is not supported`) + throw new Error(`template named '${template}' is not supported`) } return templates[template] diff --git a/packages/openapi-code-generator/src/core/cli-utils.ts b/packages/openapi-code-generator/src/core/cli-utils.ts index b2460ae12..303b7dc7a 100644 --- a/packages/openapi-code-generator/src/core/cli-utils.ts +++ b/packages/openapi-code-generator/src/core/cli-utils.ts @@ -1,5 +1,5 @@ import readline from "readline" -import { logger } from "./logger" +import {logger} from "./logger" export async function promptContinue(question: string, defaultValue?: "yes" | "no"): Promise { const answer = await prompt(question + " (yes/no) ", defaultValue) @@ -14,7 +14,7 @@ export async function prompt(question: string, defaultValue?: string): Promise { if (defaultValue && !process.stdout.isTTY) { - logger.info(`${ question } answering '${ defaultValue }' as running non-interactively`) + logger.info(`${question} answering '${defaultValue}' as running non-interactively`) return resolve(defaultValue) } diff --git a/packages/openapi-code-generator/src/core/file-loader.ts b/packages/openapi-code-generator/src/core/file-loader.ts index aaedb2256..523d81150 100644 --- a/packages/openapi-code-generator/src/core/file-loader.ts +++ b/packages/openapi-code-generator/src/core/file-loader.ts @@ -1,7 +1,7 @@ import path from "path" import fs from "fs" import yaml from "js-yaml" -import { logger } from "./logger" +import {logger} from "./logger" export async function loadFile(location: string): Promise<[string, any]> { if (isRemote(location)) { @@ -13,7 +13,7 @@ export async function loadFile(location: string): Promise<[string, any]> { async function loadLocalFile(file: string): Promise<[string, any]> { file = path.resolve(file) - const raw = fs.readFileSync(file, { encoding: "utf-8" }) + const raw = fs.readFileSync(file, {encoding: "utf-8"}) let result: any | undefined @@ -22,7 +22,7 @@ async function loadLocalFile(file: string): Promise<[string, any]> { result = JSON.parse(raw) } catch (err: any) { logger.error("error parsing json", err.stack) - throw new Error(`failed to parse json from file '${ file }'`) + throw new Error(`failed to parse json from file '${file}'`) } } @@ -31,12 +31,12 @@ async function loadLocalFile(file: string): Promise<[string, any]> { result = yaml.load(raw) } catch (err: any) { logger.error("error parsing yaml", err.stack) - throw new Error(`failed to parse yaml from file '${ file }'`) + throw new Error(`failed to parse yaml from file '${file}'`) } } if (!result) { - throw new Error(`failed to load file '${ file }'`) + throw new Error(`failed to load file '${file}'`) } return [file, result] @@ -44,7 +44,7 @@ async function loadLocalFile(file: string): Promise<[string, any]> { async function loadRemoteFile(uri: string): Promise<[string, any]> { // todo not implemented - throw new Error(`could not load ${ uri } - not implemented,`) + throw new Error(`could not load ${uri} - not implemented,`) } export function isRemote(location: string): boolean { diff --git a/packages/openapi-code-generator/src/core/generation-lib.ts b/packages/openapi-code-generator/src/core/generation-lib.ts index fbc65a086..6c1414c5d 100644 --- a/packages/openapi-code-generator/src/core/generation-lib.ts +++ b/packages/openapi-code-generator/src/core/generation-lib.ts @@ -1,4 +1,4 @@ -import { OpenapiDocument, Schema } from "./openapi-types" +import {OpenapiDocument, Schema} from "./openapi-types" export class VirtualDefinition { constructor(readonly key: string) { @@ -8,10 +8,10 @@ export class VirtualDefinition { openapi: "3.0.3", servers: [], info: { - title: `Code Generation Utilities (${ this.key })`, + title: `Code Generation Utilities (${this.key})`, description: "Definitions internal to code generation", version: "0.0.1", - contact: { email: "" }, + contact: {email: ""}, }, tags: [], paths: {}, @@ -36,7 +36,7 @@ export class GenerationLib extends VirtualDefinition { }) } - readonly UnknownObject$Ref = `${ this.key }#/components/schemas/UnknownObject` + readonly UnknownObject$Ref = `${this.key}#/components/schemas/UnknownObject` } export const generationLib = new GenerationLib() diff --git a/packages/openapi-code-generator/src/core/input.ts b/packages/openapi-code-generator/src/core/input.ts index 3e579b058..c23a5a1ec 100644 --- a/packages/openapi-code-generator/src/core/input.ts +++ b/packages/openapi-code-generator/src/core/input.ts @@ -8,9 +8,9 @@ import { Responses, Schema, } from "./openapi-types" -import { OpenapiLoader } from "./openapi-loader" -import { generationLib } from "./generation-lib" -import { isHttpMethod } from "./utils" +import {OpenapiLoader} from "./openapi-loader" +import {generationLib} from "./generation-lib" +import {isHttpMethod} from "./utils" import { IRModel, IRModelArray, IRModelBase, IRModelBoolean, IRModelNumeric, IRModelObject, @@ -20,8 +20,8 @@ import { IRRequestBody, IRResponse, MaybeIRModel, } from "./openapi-types-normalized" -import { isRef } from "./openapi-utils" -import { logger } from "./logger" +import {isRef} from "./openapi-utils" +import {logger} from "./logger" export class Input { constructor( @@ -226,7 +226,7 @@ function normalizeSchemaObject(schemaObject: Schema | Reference): MaybeIRModel { if (!items) { logger.warn("array object missing items property", schemaObject) - items = { $ref: generationLib.UnknownObject$Ref } + items = {$ref: generationLib.UnknownObject$Ref} } return type({ @@ -263,7 +263,7 @@ function normalizeSchemaObject(schemaObject: Schema | Reference): MaybeIRModel { type: schemaObject.type, }) default: - throw new Error(`unsupported type '${ schemaObject.type }'`) + throw new Error(`unsupported type '${schemaObject.type}'`) } function type(it: T) { diff --git a/packages/openapi-code-generator/src/core/logger.ts b/packages/openapi-code-generator/src/core/logger.ts index 7a6a72969..67746e532 100644 --- a/packages/openapi-code-generator/src/core/logger.ts +++ b/packages/openapi-code-generator/src/core/logger.ts @@ -35,7 +35,7 @@ export class Logger { readonly time = (description: string): void => { const now = process.hrtime.bigint() this.endTime() - this.info(`begin '${ description }'`) + this.info(`begin '${description}'`) this.times.push([description, now]) } @@ -44,7 +44,7 @@ export class Logger { const last = this.times[this.times.length - 1] if (last?.length < 3) { last.push(now) - this.info(`complete '${ last[0] }'`, { + this.info(`complete '${last[0]}'`, { elapsed: diff(last[1], last[2]), }) } @@ -58,15 +58,15 @@ export class Logger { const ms = diff(startTime, endTime || now) - result[`${ i } - ${ description }`] = `${ ms } ms, ${ Math.round(ms / total * 100) }%` + result[`${i} - ${description}`] = `${ms} ms, ${Math.round(ms / total * 100)}%` return result - }, { total: `${ total } ms` } as Record) + }, {total: `${total} ms`} as Record) } } function defaultFormat(level: string, message: string, meta?: LoggerMeta, color = Color.Reset) { - return `${ color }[${ level }]${ Color.Reset } ${ message } ${ meta ? util.inspect(meta) : "" }` + return `${color}[${level}]${Color.Reset} ${message} ${meta ? util.inspect(meta) : ""}` } function diff(start: bigint, end: bigint) { diff --git a/packages/openapi-code-generator/src/core/openapi-loader.ts b/packages/openapi-code-generator/src/core/openapi-loader.ts index 8871c7106..8070b31e1 100644 --- a/packages/openapi-code-generator/src/core/openapi-loader.ts +++ b/packages/openapi-code-generator/src/core/openapi-loader.ts @@ -1,10 +1,10 @@ import path from "path" import util from "util" -import { isRemote, loadFile } from "./file-loader" +import {isRemote, loadFile} from "./file-loader" -import { generationLib, VirtualDefinition } from "./generation-lib" -import { OpenapiValidator } from "./openapi-validator" +import {generationLib, VirtualDefinition} from "./generation-lib" +import {OpenapiValidator} from "./openapi-validator" import { OpenapiDocument, Operation, @@ -15,7 +15,7 @@ import { Response, Schema, } from "./openapi-types" -import { isRef } from "./openapi-utils" +import {isRef} from "./openapi-utils" export class OpenapiLoader { @@ -36,7 +36,7 @@ export class OpenapiLoader { this.library.set(context, def.definition) def.addSchema(name, schema) - return `${ context }#/components/schemas/${ name }` + return `${context}#/components/schemas/${name}` } get entryPoint(): OpenapiDocument { @@ -70,13 +70,13 @@ export class OpenapiLoader { return isRef(maybeRef) ? this.$ref(maybeRef) : maybeRef } - private $ref({ $ref }: Reference): T { + private $ref({$ref}: Reference): T { const [key, objPath] = $ref.split("#") const obj = this.library.get(key) if (!obj) { - throw new Error(`could not load $ref, key not loaded. $ref: '${ $ref }'`) + throw new Error(`could not load $ref, key not loaded. $ref: '${$ref}'`) } if (!objPath) { @@ -94,7 +94,7 @@ export class OpenapiLoader { result = result[segment] if (!result) { - throw new Error(`could not load $ref, path not found. $ref: '${ $ref }'`) + throw new Error(`could not load $ref, path not found. $ref: '${$ref}'`) } } @@ -122,7 +122,7 @@ export class OpenapiLoader { await this.loadFileContent(loadedFrom, definition) } - private async loadFileContent(loadedFrom: string, definition: any){ + private async loadFileContent(loadedFrom: string, definition: any) { await this.validator.validate(loadedFrom, definition) this.library.set(loadedFrom, definition) @@ -149,7 +149,7 @@ export class OpenapiLoader { let [file, objPath] = $ref.split("#") if (file === "") { - return objPath ? `${ loadedFrom }#${ objPath }` : `${ loadedFrom }` + return objPath ? `${loadedFrom}#${objPath}` : `${loadedFrom}` } if (isRemote(file)) { @@ -162,7 +162,7 @@ export class OpenapiLoader { file = path.resolve(path.dirname(loadedFrom), file) - return objPath ? `${ file }#${ objPath }` : file + return objPath ? `${file}#${objPath}` : file } function pathFromRef($ref: string) { @@ -170,7 +170,7 @@ export class OpenapiLoader { } } - static async createFromLiteral(value: object, validator: OpenapiValidator): Promise{ + static async createFromLiteral(value: object, validator: OpenapiValidator): Promise { const loader = new OpenapiLoader("input.yaml", validator) await loader.loadFileContent("input.yaml", value) @@ -189,14 +189,14 @@ export class OpenapiLoader { toJSON(): Record { return Array.from(this.library.keys()).reduce((acc, key) => { - const { title, version } = this.library.get(key)?.info ?? {} - acc[prettyKey(key)] = { title, version } + const {title, version} = this.library.get(key)?.info ?? {} + acc[prettyKey(key)] = {title, version} return acc }, {} as any) } toString(): string { - return `loaded ${ this.library.size } files: ${ Array.from(this.library.keys()).map(prettyKey).join(", ") }` + return `loaded ${this.library.size} files: ${Array.from(this.library.keys()).map(prettyKey).join(", ")}` } [util.inspect.custom](): Record { diff --git a/packages/openapi-code-generator/src/core/openapi-utils.ts b/packages/openapi-code-generator/src/core/openapi-utils.ts index 469793327..8661a3acb 100644 --- a/packages/openapi-code-generator/src/core/openapi-utils.ts +++ b/packages/openapi-code-generator/src/core/openapi-utils.ts @@ -1,4 +1,4 @@ -import { Reference } from "./openapi-types" +import {Reference} from "./openapi-types" export function isRef(it: any | Reference): it is Reference { if (!it || typeof it !== "object") { @@ -7,11 +7,11 @@ export function isRef(it: any | Reference): it is Reference { return Reflect.has(it, "$ref") } -export function getNameFromRef({ $ref }: Reference, prefix: string): string { +export function getNameFromRef({$ref}: Reference, prefix: string): string { const name = $ref.split("/").pop() if (!name) { - throw new Error(`no name found in $ref: '${ $ref }'`) + throw new Error(`no name found in $ref: '${$ref}'`) } // TODO: this is a hack to workaround reserved words being used as names diff --git a/packages/openapi-code-generator/src/core/openapi-validator.ts b/packages/openapi-code-generator/src/core/openapi-validator.ts index 0423305f5..5956bd37e 100644 --- a/packages/openapi-code-generator/src/core/openapi-validator.ts +++ b/packages/openapi-code-generator/src/core/openapi-validator.ts @@ -1,8 +1,8 @@ -import Ajv2020, { ValidateFunction } from "ajv/dist/2020" +import Ajv2020, {ValidateFunction} from "ajv/dist/2020" import addFormats from "ajv-formats" -import { promptContinue } from "./cli-utils" +import {promptContinue} from "./cli-utils" import openapi3Specification = require("./openapi-3-specification.json") -import { logger } from "./logger" +import {logger} from "./logger" export class OpenapiValidator { @@ -19,16 +19,16 @@ export class OpenapiValidator { const isValid = this.validationFunction(schema) if (!isValid) { - logger.warn(`Found errors validating '${ filename }'.`) + logger.warn(`Found errors validating '${filename}'.`) logger.warn("Note errors may cascade, and should be investigated top to bottom. Errors:\n") this.validationFunction.errors?.forEach(err => { - logger.warn(`-> ${ err.message } at path '${ err.instancePath }'`, err.params) + logger.warn(`-> ${err.message} at path '${err.instancePath}'`, err.params) }) logger.warn("") - await promptContinue(`Found errors validating '${ filename }', continue?`, "yes") + await promptContinue(`Found errors validating '${filename}', continue?`, "yes") } } diff --git a/packages/openapi-code-generator/src/index.ts b/packages/openapi-code-generator/src/index.ts index 285589620..0dadf1736 100644 --- a/packages/openapi-code-generator/src/index.ts +++ b/packages/openapi-code-generator/src/index.ts @@ -1,16 +1,16 @@ -import { logger } from "./core/logger" +import {logger} from "./core/logger" logger.time("program starting") import "source-map-support/register" -import { OpenapiLoader } from "./core/openapi-loader" -import { Input } from "./core/input" -import { OpenapiValidator } from "./core/openapi-validator" -import { config } from "./config" +import {OpenapiLoader} from "./core/openapi-loader" +import {Input} from "./core/input" +import {OpenapiValidator} from "./core/openapi-validator" +import {config} from "./config" async function main() { - logger.info(`running on input file '${ config.input }'`) + logger.info(`running on input file '${config.input}'`) logger.time("load files") @@ -22,7 +22,7 @@ async function main() { logger.time("generation") // TODO abort generation if not a git repo or there are uncommitted changes - await config.generator({ input, dest: config.output }) + await config.generator({input, dest: config.output}) } main() diff --git a/packages/openapi-code-generator/src/templates.ts b/packages/openapi-code-generator/src/templates.ts index d009ae8da..ebf9c1916 100644 --- a/packages/openapi-code-generator/src/templates.ts +++ b/packages/openapi-code-generator/src/templates.ts @@ -1,8 +1,8 @@ -import { Input } from "./core/input" +import {Input} from "./core/input" -import { generateTypescriptAngular } from "./typescript/typescript-angular/typescript-angular.generator" -import { generateTypescriptFetch } from "./typescript/typescript-fetch/typescript-fetch.generator" -import { generateTypescriptKoa } from "./typescript/typescript-koa/typescript-koa.generator" +import {generateTypescriptAngular} from "./typescript/typescript-angular/typescript-angular.generator" +import {generateTypescriptFetch} from "./typescript/typescript-fetch/typescript-fetch.generator" +import {generateTypescriptKoa} from "./typescript/typescript-koa/typescript-koa.generator" export interface OpenapiGenerator { (args: { dest: string, input: Input }): Promise diff --git a/packages/openapi-code-generator/src/test/unit-test-inputs.yaml b/packages/openapi-code-generator/src/test/unit-test-inputs.yaml index 88f0836ae..d46a58f04 100644 --- a/packages/openapi-code-generator/src/test/unit-test-inputs.yaml +++ b/packages/openapi-code-generator/src/test/unit-test-inputs.yaml @@ -26,13 +26,13 @@ components: type: string ObjectWithRefs: - required: - - requiredObject - properties: - optionalObject: - $ref: '#/components/schemas/SimpleObject' - requiredObject: - $ref: '#/components/schemas/SimpleObject' + required: + - requiredObject + properties: + optionalObject: + $ref: '#/components/schemas/SimpleObject' + requiredObject: + $ref: '#/components/schemas/SimpleObject' OneOf: oneOf: diff --git a/packages/openapi-code-generator/src/typescript/common/client-builder.ts b/packages/openapi-code-generator/src/typescript/common/client-builder.ts index bf4a5b36d..aad3e1eba 100644 --- a/packages/openapi-code-generator/src/typescript/common/client-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/client-builder.ts @@ -1,7 +1,7 @@ -import { IROperation } from "../../core/openapi-types-normalized" -import { ImportBuilder } from "./import-builder" -import { ModelBuilder } from "./model-builder" -import { ClientOperationBuilder } from "./client-operation-builder" +import {IROperation} from "../../core/openapi-types-normalized" +import {ImportBuilder} from "./import-builder" +import {ModelBuilder} from "./model-builder" +import {ClientOperationBuilder} from "./client-operation-builder" export abstract class TypescriptClientBuilder { private readonly imports: ImportBuilder @@ -32,9 +32,9 @@ export abstract class TypescriptClientBuilder { toString(): string { return ` - ${ this.imports.toString() } + ${this.imports.toString()} - ${ this.buildClient(this.name, this.operations) } + ${this.buildClient(this.name, this.operations)} ` } } diff --git a/packages/openapi-code-generator/src/typescript/common/client-operation-builder.ts b/packages/openapi-code-generator/src/typescript/common/client-operation-builder.ts index 9a6073b71..c42b9a00d 100644 --- a/packages/openapi-code-generator/src/typescript/common/client-operation-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/client-operation-builder.ts @@ -1,8 +1,8 @@ import _ from "lodash" -import { IROperation, IRParameter, MaybeIRModel } from "../../core/openapi-types-normalized" -import { isDefined } from "../../core/utils" -import { generationLib } from "../../core/generation-lib" -import { ModelBuilder } from "./model-builder" +import {IROperation, IRParameter, MaybeIRModel} from "../../core/openapi-types-normalized" +import {isDefined} from "../../core/utils" +import {generationLib} from "../../core/generation-lib" +import {ModelBuilder} from "./model-builder" import {combineParams, MethodParameterDefinition, requestBodyAsParameter} from "./typescript-common" export class ClientOperationBuilder { @@ -25,14 +25,14 @@ export class ClientOperationBuilder { } methodParameter(): MethodParameterDefinition | undefined { - const { parameters } = this.operation - const { requestBodyParameter } = this.requestBodyAsParameter() + const {parameters} = this.operation + const {requestBodyParameter} = this.requestBodyAsParameter() return combineParams( [...parameters, requestBodyParameter] .filter(isDefined) .map(it => ({ - name: `${ _.camelCase(it.name) }`, + name: `${_.camelCase(it.name)}`, type: this.models.schemaObjectToType(it.schema), required: it.required, })), @@ -44,7 +44,7 @@ export class ClientOperationBuilder { } queryString(): string { - const { parameters } = this.operation + const {parameters} = this.operation return parameters.filter(it => it.in === "query") .map(it => "'" + it.name + "': " + this.paramName(it.name)) @@ -52,21 +52,21 @@ export class ClientOperationBuilder { } headers(): string { - const { parameters } = this.operation + const {parameters} = this.operation return parameters.filter(it => it.in === "header") - .map(it => `'${ it.name }': ${ this.paramName(it.name) }`) + .map(it => `'${it.name}': ${this.paramName(it.name)}`) .join(",\n") } hasHeader(name: string): boolean { - const { parameters } = this.operation + const {parameters} = this.operation return parameters .find(it => it.in === "header" && it.name.toLowerCase() === name.toLowerCase()) !== null } - returnType(): {statusType: string, responseType: string}[] { + returnType(): { statusType: string, responseType: string }[] { const models = this.models return this.responsesToArray() @@ -80,14 +80,14 @@ export class ClientOperationBuilder { } paramName(name: string): string { - return `p['${ _.camelCase(name) }']` + return `p['${_.camelCase(name)}']` } private responsesToArray(): { status: string, definition: null | MaybeIRModel }[] { - const { responses } = this.operation + const {responses} = this.operation if (!responses) { - return [{ status: "number", definition: { $ref: generationLib.UnknownObject$Ref } }] + return [{status: "number", definition: {$ref: generationLib.UnknownObject$Ref}}] } return Object.entries(responses) @@ -96,10 +96,10 @@ export class ClientOperationBuilder { const responseContent = Object.values(response?.content || {}).pop() if (!responseContent) { - return { status, definition: null } + return {status, definition: null} } - return { status, definition: responseContent.schema } + return {status, definition: responseContent.schema} }) } diff --git a/packages/openapi-code-generator/src/typescript/common/import-builder.spec.ts b/packages/openapi-code-generator/src/typescript/common/import-builder.spec.ts index 72dc16224..a62d8cab0 100644 --- a/packages/openapi-code-generator/src/typescript/common/import-builder.spec.ts +++ b/packages/openapi-code-generator/src/typescript/common/import-builder.spec.ts @@ -1,5 +1,5 @@ -import { describe, it, expect } from "@jest/globals" -import { ImportBuilder } from "./import-builder" +import {describe, it, expect} from "@jest/globals" +import {ImportBuilder} from "./import-builder" describe("typescript/common/import-builder", () => { diff --git a/packages/openapi-code-generator/src/typescript/common/import-builder.ts b/packages/openapi-code-generator/src/typescript/common/import-builder.ts index 9881e0c1c..872c2f542 100644 --- a/packages/openapi-code-generator/src/typescript/common/import-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/import-builder.ts @@ -51,13 +51,13 @@ export class ImportBuilder { .sort() .join(", ") - return `import ${ [ + return `import ${[ this.importAll[from] ? this.importAll[from] : "", - individualImports.length > 0 ? `{${ individualImports }}` : "", + individualImports.length > 0 ? `{${individualImports}}` : "", ] .filter(it => it.length) .join(", ") - } from '${ from }'` + } from '${from}'` }) .join("\n") } diff --git a/packages/openapi-code-generator/src/typescript/common/model-builder.spec.ts b/packages/openapi-code-generator/src/typescript/common/model-builder.spec.ts index faa8e64e6..e63a15a4b 100644 --- a/packages/openapi-code-generator/src/typescript/common/model-builder.spec.ts +++ b/packages/openapi-code-generator/src/typescript/common/model-builder.spec.ts @@ -1,7 +1,7 @@ -import { describe, beforeAll, it, expect } from "@jest/globals" -import { unitTestInput } from "../../test/input.test-utils" -import { Input } from "../../core/input" -import { ModelBuilder } from "./model-builder" +import {describe, beforeAll, it, expect} from "@jest/globals" +import {unitTestInput} from "../../test/input.test-utils" +import {Input} from "../../core/input" +import {ModelBuilder} from "./model-builder" describe("typescript/common/model-builder", () => { let input: Input @@ -18,7 +18,7 @@ describe("typescript/common/model-builder", () => { const builder = ModelBuilder.fromInput("models.ts", input) const actual = builder.schemaObjectToType( - input.schema({ $ref: `${file}#/components/schemas/SimpleObject` }) + input.schema({$ref: `${file}#/components/schemas/SimpleObject`}) ) expect(actual).toMatchInlineSnapshot(` @@ -36,7 +36,7 @@ describe("typescript/common/model-builder", () => { const builder = ModelBuilder.fromInput("models.ts", input) const actual = builder.schemaObjectToType( - input.schema({ $ref: `${file}#/components/schemas/ObjectWithRefs` }) + input.schema({$ref: `${file}#/components/schemas/ObjectWithRefs`}) ) expect(actual).toMatchInlineSnapshot(` @@ -51,7 +51,7 @@ describe("typescript/common/model-builder", () => { const builder = ModelBuilder.fromInput("models.ts", input) const actual = builder.schemaObjectToType( - input.schema({ $ref: `${file}#/components/schemas/OneOf` }) + input.schema({$ref: `${file}#/components/schemas/OneOf`}) ) expect(actual).toMatchInlineSnapshot(` @@ -67,7 +67,7 @@ describe("typescript/common/model-builder", () => { const builder = ModelBuilder.fromInput("models.ts", input) const actual = builder.schemaObjectToType( - input.schema({ $ref: `${file}#/components/schemas/AllOf` }) + input.schema({$ref: `${file}#/components/schemas/AllOf`}) ) expect(actual).toMatchInlineSnapshot(` diff --git a/packages/openapi-code-generator/src/typescript/common/model-builder.ts b/packages/openapi-code-generator/src/typescript/common/model-builder.ts index 08d9e45dd..74c48ab8c 100644 --- a/packages/openapi-code-generator/src/typescript/common/model-builder.ts +++ b/packages/openapi-code-generator/src/typescript/common/model-builder.ts @@ -1,8 +1,8 @@ -import { IRModelArray, MaybeIRModel } from "../../core/openapi-types-normalized" -import { Input } from "../../core/input" -import { Reference } from "../../core/openapi-types" -import { getNameFromRef, isRef } from "../../core/openapi-utils" -import { ImportBuilder } from "./import-builder" +import {IRModelArray, MaybeIRModel} from "../../core/openapi-types-normalized" +import {Input} from "../../core/input" +import {Reference} from "../../core/openapi-types" +import {getNameFromRef, isRef} from "../../core/openapi-utils" +import {ImportBuilder} from "./import-builder" export class ModelBuilder { @@ -22,10 +22,10 @@ export class ModelBuilder { ) } - private add({ $ref }: Reference): string { + private add({$ref}: Reference): string { this.referenced.add($ref) - const name = getNameFromRef({ $ref }, "t_") + const name = getNameFromRef({$ref}, "t_") if (this.imports) { this.imports.addSingle(name, this.filename) @@ -54,26 +54,26 @@ export class ModelBuilder { } private generateModelFromRef($ref: string): string { - const name = getNameFromRef({ $ref }, "t_") - const schemaObject = this.input.schema({ $ref }) + const name = getNameFromRef({$ref}, "t_") + const schemaObject = this.input.schema({$ref}) // Arrays if (schemaObject.type === "array") { return ` - export type ${ name } = ${ this.itemsToType(schemaObject.items) }[]; + export type ${name} = ${this.itemsToType(schemaObject.items)}[]; ` } // Objects if (schemaObject.type === "object" || schemaObject.type === undefined) { return ` - export type ${ name } = ${ this.schemaObjectToType(schemaObject) } + export type ${name} = ${this.schemaObjectToType(schemaObject)} ` } // Primitives return ` - export type ${ name } = ${ this.schemaObjectToType(schemaObject) } + export type ${name} = ${this.schemaObjectToType(schemaObject)} ` } @@ -85,10 +85,10 @@ export class ModelBuilder { // todo unofficial extension to openapi3 - items doesn't normally accept an array. if (Array.isArray(items)) { - return `( ${ items.map(this.schemaObjectToType).join(" | ") } )` + return `( ${items.map(this.schemaObjectToType).join(" | ")} )` } - return `${ this.schemaObjectToType(items) }` + return `${this.schemaObjectToType(items)}` } @@ -99,16 +99,16 @@ export class ModelBuilder { } if (schemaObject.type === "object" && schemaObject.allOf.length) { - return `(${ schemaObject.allOf.map(this.schemaObjectToType).join(" & ") })` + return `(${schemaObject.allOf.map(this.schemaObjectToType).join(" & ")})` } - if(schemaObject.type === "object" && schemaObject.oneOf.length){ - return `(${ schemaObject.oneOf.map(this.schemaObjectToType).join("\n | ") })` + if (schemaObject.type === "object" && schemaObject.oneOf.length) { + return `(${schemaObject.oneOf.map(this.schemaObjectToType).join("\n | ")})` } switch (schemaObject.type) { case "array": { - return `${ this.itemsToType(schemaObject.items) }[]` + return `${this.itemsToType(schemaObject.items)}[]` } case "boolean": { return "boolean" @@ -116,7 +116,7 @@ export class ModelBuilder { case "string": { if (schemaObject.enum) { return schemaObject.enum - .map(it => `"${ it }"`) + .map(it => `"${it}"`) .join(" | ") } @@ -126,7 +126,7 @@ export class ModelBuilder { // todo support bigint as string if (Array.isArray(schemaObject.enum)) { return schemaObject.enum - .map(it => `${ it }`) + .map(it => `${it}`) .join(" | ") } @@ -177,7 +177,7 @@ export class ModelBuilder { ].filter(Boolean).join("\n") } default: { - throw new Error(`unsupported type '${ JSON.stringify(schemaObject, undefined, 2) }'`) + throw new Error(`unsupported type '${JSON.stringify(schemaObject, undefined, 2)}'`) } } } diff --git a/packages/openapi-code-generator/src/typescript/common/output-utils.ts b/packages/openapi-code-generator/src/typescript/common/output-utils.ts index fd93cd6e8..4068c1f58 100644 --- a/packages/openapi-code-generator/src/typescript/common/output-utils.ts +++ b/packages/openapi-code-generator/src/typescript/common/output-utils.ts @@ -1,7 +1,7 @@ import fs from "fs" import path from "path" import prettier from "prettier" -import { logger } from "../../core/logger" +import {logger} from "../../core/logger" export type CompilationUnit = { filename: string, toString: () => string } @@ -50,14 +50,14 @@ async function formatOutput(raw: string): Promise { arrowParens: "always", parser: "typescript", }) - } catch (err){ + } catch (err) { logger.error("failed to prettier", {err}) return raw } } async function writeOutput(folder: string, filename: string, data: string) { - fs.mkdirSync(folder, { recursive: true }) + fs.mkdirSync(folder, {recursive: true}) fs.writeFileSync(path.join(folder, filename), data, { encoding: "utf-8", }) diff --git a/packages/openapi-code-generator/src/typescript/common/typescript-common.ts b/packages/openapi-code-generator/src/typescript/common/typescript-common.ts index 596cea996..210ad34ba 100644 --- a/packages/openapi-code-generator/src/typescript/common/typescript-common.ts +++ b/packages/openapi-code-generator/src/typescript/common/typescript-common.ts @@ -1,5 +1,5 @@ import _ from "lodash" -import { isDefined } from "../../core/utils" +import {isDefined} from "../../core/utils" import {IROperation, IRParameter} from "../../core/openapi-types-normalized" import {logger} from "../../core/logger" @@ -60,25 +60,28 @@ export function routeToTemplateString(route: string, paramName = "p"): string { }, route) } -export function buildMethod({ name, parameters, returnType, overloads = [], body }: MethodDefinition): string { +export function buildMethod({name, parameters, returnType, overloads = [], body}: MethodDefinition): string { return ` - ${ overloads.map(it => `${ name }(${ params(it.parameters) }): ${ it.returnType };`).join("\n") } - ${ name }(${ params(parameters) }): ${ returnType } + ${overloads.map(it => `${name}(${params(it.parameters)}): ${it.returnType};`).join("\n")} + ${name}(${params(parameters)}): ${returnType} { - ${ body } + ${body} }` } -export function asyncMethod({ name, parameters, returnType, overloads = [], body }: MethodDefinition): string { +export function asyncMethod({name, parameters, returnType, overloads = [], body}: MethodDefinition): string { return ` - ${ overloads.map(it => `async ${ name }(${ params(it.parameters) }): Promise<${ it.returnType }>;`).join("\n") } - async ${ name }(${ params(parameters) }): Promise<${ returnType }> + ${overloads.map(it => `async ${name}(${params(it.parameters)}): Promise<${it.returnType}>;`).join("\n")} + async ${name}(${params(parameters)}): Promise<${returnType}> { - ${ body } + ${body} }` } -export function requestBodyAsParameter(operation: IROperation): { requestBodyParameter?: IRParameter, requestBodyContentType?: string } { +export function requestBodyAsParameter(operation: IROperation): { + requestBodyParameter?: IRParameter, + requestBodyContentType?: string +} { const {requestBody} = operation if (!requestBody) { @@ -108,15 +111,15 @@ export function requestBodyAsParameter(operation: IROperation): { requestBodyPar export function ifElseIfBuilder(parts: ({ condition?: string, body: string } | undefined)[]) { const result = [] - const definedParts = parts.filter(isDefined).sort((a,b) => a.condition && !b.condition ? -1 : 1) + const definedParts = parts.filter(isDefined).sort((a, b) => a.condition && !b.condition ? -1 : 1) for (const {condition, body} of definedParts) { if (result.length === 0 && condition) { - result.push(`if(${ condition }) { ${ body } }`) + result.push(`if(${condition}) { ${body} }`) } else if (condition) { - result.push(`else if(${ condition }) { ${ body } }`) - } else if(result.length > 0) { - result.push(`else { ${ body } }`) + result.push(`else if(${condition}) { ${body} }`) + } else if (result.length > 0) { + result.push(`else { ${body} }`) } else { result.push(body) } @@ -130,8 +133,8 @@ function params(parameters: (MethodParameterDefinition | undefined)[], quoteName return parameters .filter(isDefined) .map((param) => { - const name = quoteNames ? `"${ param.name }"` : param.name - return `${ name }${ param.required === false ? "?" : "" }: ${ (param.type) }` + const name = quoteNames ? `"${param.name}"` : param.name + return `${name}${param.required === false ? "?" : ""}: ${(param.type)}` }) .join(",") } diff --git a/packages/openapi-code-generator/src/typescript/typescript-angular/angular-module-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-angular/angular-module-builder.ts index 15b962210..dda6c9331 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-angular/angular-module-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-angular/angular-module-builder.ts @@ -1,4 +1,4 @@ -import { ImportBuilder } from "../common/import-builder" +import {ImportBuilder} from "../common/import-builder" export class AngularModuleBuilder { @@ -57,23 +57,23 @@ export class AngularModuleBuilder { toString(): string { const name = this.name return ` -${ this.tsImports.toString() } +${this.tsImports.toString()} @NgModule({ imports: [ - ${ this.sorted(this.ngImports).join(",\n") } + ${this.sorted(this.ngImports).join(",\n")} ], declarations: [ - ${ this.sorted(this.ngDeclarations).join(",\n") } + ${this.sorted(this.ngDeclarations).join(",\n")} ], exports: [ - ${ this.sorted(this.ngExports).join(",\n") } + ${this.sorted(this.ngExports).join(",\n")} ], providers: [ - ${ this.sorted(this.ngProviders).join(",\n") } + ${this.sorted(this.ngProviders).join(",\n")} ], }) -export class ${ name }Module {} +export class ${name}Module {} ` } } diff --git a/packages/openapi-code-generator/src/typescript/typescript-angular/angular-service-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-angular/angular-service-builder.ts index ac3765021..913c73d4c 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-angular/angular-service-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-angular/angular-service-builder.ts @@ -1,8 +1,8 @@ -import { TypescriptClientBuilder } from "../common/client-builder" -import { ImportBuilder } from "../common/import-builder" -import { ClientOperationBuilder } from "../common/client-operation-builder" -import { buildMethod, routeToTemplateString } from "../common/typescript-common" -import { isDefined } from "../../core/utils" +import {TypescriptClientBuilder} from "../common/client-builder" +import {ImportBuilder} from "../common/import-builder" +import {ClientOperationBuilder} from "../common/client-operation-builder" +import {buildMethod, routeToTemplateString} from "../common/typescript-common" +import {isDefined} from "../../core/utils" export class AngularServiceBuilder extends TypescriptClientBuilder { @@ -24,8 +24,8 @@ export class AngularServiceBuilder extends TypescriptClientBuilder { } protected buildOperation(builder: ClientOperationBuilder): string { - const { operationId, route, method } = builder - const { requestBodyParameter, requestBodyContentType } = builder.requestBodyAsParameter() + const {operationId, route, method} = builder + const {requestBodyParameter, requestBodyContentType} = builder.requestBodyAsParameter() const operationParameter = builder.methodParameter() @@ -35,8 +35,8 @@ export class AngularServiceBuilder extends TypescriptClientBuilder { const hasAcceptHeader = builder.hasHeader("Accept") const returnType = builder.returnType() - .map(({ responseType }) => { - return `${ responseType }` + .map(({responseType}) => { + return `${responseType}` }) .join(" | ") @@ -46,21 +46,21 @@ export class AngularServiceBuilder extends TypescriptClientBuilder { const headers: Record = {${ [ hasAcceptHeader ? undefined : "'Accept': 'application/json',", - requestBodyContentType ? `'Content-Type': '${ requestBodyContentType }',` : undefined, + requestBodyContentType ? `'Content-Type': '${requestBodyContentType}',` : undefined, headers || undefined, ] .filter(isDefined) .join("\n") }} -const queryParameters = {${ queryString }}; +const queryParameters = {${queryString}}; return this.httpClient.request( - "${ method }", - this.config.basePath + \`${ url }\`, { + "${method}", + this.config.basePath + \`${url}\`, { params: this.queryParams(queryParameters), headers: this.headers(headers), - ${ requestBodyParameter ? `body: ${ builder.paramName(requestBodyParameter.name) },` : "" } + ${requestBodyParameter ? `body: ${builder.paramName(requestBodyParameter.name)},` : ""} observe: 'body', reportProgress: false, }); @@ -69,14 +69,14 @@ return this.httpClient.request( return buildMethod({ name: operationId, parameters: [operationParameter], - returnType: `Observable<${ returnType }>`, + returnType: `Observable<${returnType}>`, body, }) } protected buildClient(clientName: string, clientMethods: string[]): string { return ` -export class ${ clientName }Config { +export class ${clientName}Config { basePath: string = '' defaultHeaders: Record = {} } @@ -89,10 +89,10 @@ export interface Res { @Injectable({ providedIn: 'root' }) -export class ${ clientName } { +export class ${clientName} { constructor( private readonly httpClient: HttpClient, - private readonly config: ${ clientName }Config, + private readonly config: ${clientName}Config, ) {} private headers(headers: Record): Record { @@ -112,7 +112,7 @@ export class ${ clientName } { return result } - ${ clientMethods.join("\n") } + ${clientMethods.join("\n")} }` } } diff --git a/packages/openapi-code-generator/src/typescript/typescript-angular/typescript-angular.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-angular/typescript-angular.generator.ts index 64d3cc138..85c31e1c8 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-angular/typescript-angular.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-angular/typescript-angular.generator.ts @@ -1,10 +1,10 @@ -import { ModelBuilder } from "../common/model-builder" -import { Input } from "../../core/input" -import { emitGenerationResult } from "../common/output-utils" -import { AngularModuleBuilder } from "./angular-module-builder" -import { AngularServiceBuilder } from "./angular-service-builder" +import {ModelBuilder} from "../common/model-builder" +import {Input} from "../../core/input" +import {emitGenerationResult} from "../common/output-utils" +import {AngularModuleBuilder} from "./angular-module-builder" +import {AngularServiceBuilder} from "./angular-service-builder" -export async function generateTypescriptAngular({ dest, input }: { dest: string, input: Input }): Promise { +export async function generateTypescriptAngular({dest, input}: { dest: string, input: Input }): Promise { const models = ModelBuilder.fromInput("./models.ts", input) const client = new AngularServiceBuilder( diff --git a/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts index e0c69ca5f..621016381 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch-client-builder.ts @@ -1,54 +1,53 @@ -import { TypescriptClientBuilder } from "../common/client-builder" -import { ImportBuilder } from "../common/import-builder" -import { ClientOperationBuilder } from "../common/client-operation-builder" -import { asyncMethod, routeToTemplateString } from "../common/typescript-common" -import { isDefined } from "../../core/utils" +import {TypescriptClientBuilder} from "../common/client-builder" +import {ImportBuilder} from "../common/import-builder" +import {ClientOperationBuilder} from "../common/client-operation-builder" +import {asyncMethod, routeToTemplateString} from "../common/typescript-common" +import {isDefined} from "../../core/utils" export class TypescriptFetchClientBuilder extends TypescriptClientBuilder { - protected buildImports(imports: ImportBuilder): void { - imports - .from("querystring") - .all("qs") - } - - protected buildOperation(builder: ClientOperationBuilder): string { - const { operationId, route, method } = builder - const { requestBodyParameter, requestBodyContentType } = builder.requestBodyAsParameter() + protected buildImports(imports: ImportBuilder): void { + imports + .from("querystring") + .all("qs") + } - const operationParameter = builder.methodParameter() + protected buildOperation(builder: ClientOperationBuilder): string { + const {operationId, route, method} = builder + const {requestBodyParameter, requestBodyContentType} = builder.requestBodyAsParameter() - const queryString = builder.queryString() - const headers = builder.headers() + const operationParameter = builder.methodParameter() - const hasAcceptHeader = builder.hasHeader("Accept") + const queryString = builder.queryString() + const headers = builder.headers() - const returnType = builder.returnType() - .map(({ statusType, responseType }) => { - return `Res<${ statusType },${ responseType }>` - }) - .join(" | ") + const hasAcceptHeader = builder.hasHeader("Accept") + const returnType = builder.returnType() + .map(({statusType, responseType}) => { + return `Res<${statusType},${responseType}>` + }) + .join(" | ") - const url = "`" + routeToTemplateString(route) + (queryString ? "?${this._query({" + queryString + "})}" : "") + "`" - const body = ` + const url = "`" + routeToTemplateString(route) + (queryString ? "?${this._query({" + queryString + "})}" : "") + "`" + const body = ` const headers: Record = {${ - [ - hasAcceptHeader ? undefined : "'Accept': 'application/json',", - requestBodyContentType ? `'Content-Type': '${ requestBodyContentType }',` : undefined, - headers || undefined, - ] - .filter(isDefined) - .join("\n") - }} - -const res = await fetch(this.config.basePath + ${ url }, + [ + hasAcceptHeader ? undefined : "'Accept': 'application/json',", + requestBodyContentType ? `'Content-Type': '${requestBodyContentType}',` : undefined, + headers || undefined, + ] + .filter(isDefined) + .join("\n") + }} + +const res = await fetch(this.config.basePath + ${url}, { - method: "${ method }", + method: "${method}", headers: this._headers(headers), - ${ requestBodyParameter ? "body: JSON.stringify(p.requestBody)," : "" } + ${requestBodyParameter ? "body: JSON.stringify(p.requestBody)," : ""} }) // TODO: this is a poor assumption @@ -56,17 +55,17 @@ return {status: res.status as any, body: (await res.json() as any)}; ` - return asyncMethod({ - name: operationId, - parameters: [operationParameter], - returnType, - body, - }) - } - - protected buildClient(clientName: string, clientMethods: string[]): string { - return ` -export interface ${ clientName }Config { + return asyncMethod({ + name: operationId, + parameters: [operationParameter], + returnType, + body, + }) + } + + protected buildClient(clientName: string, clientMethods: string[]): string { + return ` +export interface ${clientName}Config { basePath: string defaultHeaders: Record } @@ -76,8 +75,8 @@ export interface Res { body: Body } -export class ${ clientName } { - constructor(private readonly config: ${ clientName }Config) {} +export class ${clientName} { + constructor(private readonly config: ${clientName}Config) {} private _query(params: Record): string { const filtered = Object.fromEntries( @@ -95,7 +94,7 @@ export class ${ clientName } { ) } - ${ clientMethods.join("\n") } + ${clientMethods.join("\n")} }` - } + } } diff --git a/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch.generator.ts b/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch.generator.ts index 76b0d909f..e98c076b2 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch.generator.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-fetch/typescript-fetch.generator.ts @@ -1,9 +1,9 @@ -import { Input } from "../../core/input" -import { emitGenerationResult } from "../common/output-utils" -import { ModelBuilder } from "../common/model-builder" -import { TypescriptFetchClientBuilder } from "./typescript-fetch-client-builder" +import {Input} from "../../core/input" +import {emitGenerationResult} from "../common/output-utils" +import {ModelBuilder} from "../common/model-builder" +import {TypescriptFetchClientBuilder} from "./typescript-fetch-client-builder" -export async function generateTypescriptFetch({ dest, input }: { dest: string, input: Input }): Promise { +export async function generateTypescriptFetch({dest, input}: { dest: string, input: Input }): Promise { const models = ModelBuilder.fromInput("./models.ts", input) const client = new TypescriptFetchClientBuilder( diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts index 17b02a631..6241056f0 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/abstract-schema-builder.ts @@ -48,11 +48,11 @@ export abstract class AbstractSchemaBuilder { } private generateSchemaFromRef($ref: string): string { - const name = getNameFromRef({ $ref }, "s_") - const schemaObject = this.input.schema({ $ref }) + const name = getNameFromRef({$ref}, "s_") + const schemaObject = this.input.schema({$ref}) return ` - export const ${ name } = ${ this.fromModel(schemaObject, true) } + export const ${name} = ${this.fromModel(schemaObject, true)} ` } diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts index 73aca0526..29c4450a1 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/joi-schema-builder.ts @@ -35,6 +35,7 @@ export class JoiBuilder extends AbstractSchemaBuilder { // TODO: implement throw new Error("Method not implemented.") } + public void(): string { // TODO: implement throw new Error("Method not implemented.") diff --git a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts index a09f9ebde..d4d153211 100644 --- a/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts +++ b/packages/openapi-code-generator/src/typescript/typescript-koa/schema-builders/zod-schema-builder.spec.ts @@ -1,12 +1,12 @@ -import { describe, it, expect } from "@jest/globals" -import { ZodBuilder } from "./zod-schema-builder" -import { unitTestInput } from "../../../test/input.test-utils" -import { ImportBuilder } from "../../common/import-builder" +import {describe, it, expect} from "@jest/globals" +import {ZodBuilder} from "./zod-schema-builder" +import {unitTestInput} from "../../../test/input.test-utils" +import {ImportBuilder} from "../../common/import-builder" describe("zod-schema-builder", () => { it("supports unions / oneOf", async () => { - const { input, file } = await unitTestInput() - const schema = input.schema({ $ref: `${file}#components/schemas/OneOf` }) + const {input, file} = await unitTestInput() + const schema = input.schema({$ref: `${file}#components/schemas/OneOf`}) const builder = new ZodBuilder( "z", @@ -27,8 +27,8 @@ describe("zod-schema-builder", () => { }) it("supports allOf", async () => { - const { input, file } = await unitTestInput() - const schema = input.schema({ $ref: `${file}#components/schemas/AllOf` }) + const {input, file} = await unitTestInput() + const schema = input.schema({$ref: `${file}#components/schemas/AllOf`}) const builder = new ZodBuilder( "z", diff --git a/packages/openapi-code-generator/tsconfig.json b/packages/openapi-code-generator/tsconfig.json index 8e023b676..c0973ff5c 100644 --- a/packages/openapi-code-generator/tsconfig.json +++ b/packages/openapi-code-generator/tsconfig.json @@ -2,7 +2,9 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./dist", - "rootDir": "./src", + "rootDir": "./src" }, - "include": ["src/**/*"] + "include": [ + "src/**/*" + ] } diff --git a/packages/typescript-koa-runtime/src/server.ts b/packages/typescript-koa-runtime/src/server.ts index 8c8651a19..ccb18aa96 100644 --- a/packages/typescript-koa-runtime/src/server.ts +++ b/packages/typescript-koa-runtime/src/server.ts @@ -15,14 +15,14 @@ type IntRange = F extends T ? never : Exclude, Enumerate> | T -export type StatusCode1xx = IntRange<100,199> // `1${number}${number}` -export type StatusCode2xx = IntRange<200,299> // `2${number}${number}` -export type StatusCode3xx = IntRange<300,399> // `3${number}${number}` -export type StatusCode4xx = IntRange<400,499> // `4${number}${number}` -export type StatusCode5xx = IntRange<500,599> // `5${number}${number}` +export type StatusCode1xx = IntRange<100, 199> // `1${number}${number}` +export type StatusCode2xx = IntRange<200, 299> // `2${number}${number}` +export type StatusCode3xx = IntRange<300, 399> // `3${number}${number}` +export type StatusCode4xx = IntRange<400, 499> // `4${number}${number}` +export type StatusCode5xx = IntRange<500, 599> // `5${number}${number}` export type StatusCode = StatusCode1xx | StatusCode2xx | StatusCode3xx | StatusCode4xx | StatusCode5xx -export type Response = {status: Status, body: Type} +export type Response = { status: Status, body: Type } export type ServerConfig = { middleware?: Middleware[] diff --git a/packages/typescript-koa-runtime/tsconfig.json b/packages/typescript-koa-runtime/tsconfig.json index 90d76d7e8..c0973ff5c 100644 --- a/packages/typescript-koa-runtime/tsconfig.json +++ b/packages/typescript-koa-runtime/tsconfig.json @@ -4,5 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": ["src/**/*"] + "include": [ + "src/**/*" + ] }